Skip to content

Commit

Permalink
Merge pull request #40 from foretagsplatsen/abstract-testcase-execution
Browse files Browse the repository at this point in the history
Fix abstract test case execution (#38)
  • Loading branch information
BenjaminVanRyseghem authored Feb 10, 2017
2 parents ae7aa76 + 5b77d49 commit dc672bc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/testCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ define([

// All test classes are singletons.
// TODO: Refactor with a super call when we"ll have super on class-side.
that.subclass = (function(superSubclass, options) {
return function(builder) {
that.subclass = (function(superSubclass) {
return function(builder, options) {
var klass = superSubclass.apply(that, [builder]);

if (options && options.isAbstract) {
Expand Down
28 changes: 28 additions & 0 deletions test/src/abstractTestCaseSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
define([
"src/testCase"
], function(testCase) {

var a = testCase.abstractSubclass(function(that, my) {

my.name = function() {
return "Abstract test case";
};

my.createObject = function() {
return "a";
};

my.shouldNotExecuteTestsTest = function() {
expect(my.createObject()).toBe("b");
};
});

var b = a.subclass(function(that, my) {

my.createObject = function() {
return "b";
};
});

return b;
});
1 change: 1 addition & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define([], function() {
"test/src/getterSetterSpec",
"test/src/singletonSpec",
"test/src/testCaseSpec",
"test/src/abstractTestCaseSpec",
"test/src/propertyListenersSpec"
];
return {
Expand Down

0 comments on commit dc672bc

Please sign in to comment.