jasmine-core 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/console/console.js +1 -0
- data/lib/jasmine-core.js +27 -0
- data/lib/jasmine-core/boot.js +1 -62
- data/lib/jasmine-core/boot/boot.js +1 -62
- data/lib/jasmine-core/boot/node_boot.js +1 -53
- data/lib/jasmine-core/jasmine.css +2 -0
- data/lib/jasmine-core/jasmine.js +85 -8
- data/lib/jasmine-core/node_boot.js +1 -53
- data/lib/jasmine-core/spec/console/ConsoleReporterSpec.js +1 -0
- data/lib/jasmine-core/spec/core/MockDateSpec.js +25 -5
- data/lib/jasmine-core/spec/core/SuiteSpec.js +36 -2
- data/lib/jasmine-core/version.rb +1 -1
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c4cf0529b3fa9d73a1d2564efe07c6179aeb27e
|
4
|
+
data.tar.gz: 2ed25d81371e194e2327a346c9371aa708277261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78bc77920cc082290ba96c3f460702bcd87270b25b1602857c604d87ddc5625d9327378d8deb39ef67ee70e64a4f9ad3e7783cf68911c5460725ad6669e371b0
|
7
|
+
data.tar.gz: 8e427d33f10cfb7d79ba3d61bb8f449d9fef7c82d5205b807e21f2c91949e0823b4e9646a02e4178d5765d6ce9e2982b6ab1992411a21a09bcafb91b2ff6d4f9
|
data/lib/console/console.js
CHANGED
@@ -154,6 +154,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
|
154
154
|
for (var i = 0; i < result.failedExpectations.length; i++) {
|
155
155
|
var failedExpectation = result.failedExpectations[i];
|
156
156
|
printNewline();
|
157
|
+
print(indent(failedExpectation.message, 2));
|
157
158
|
print(indent(failedExpectation.stack, 2));
|
158
159
|
}
|
159
160
|
|
data/lib/jasmine-core.js
CHANGED
@@ -1,2 +1,29 @@
|
|
1
1
|
module.exports = require("./jasmine-core/jasmine.js");
|
2
2
|
module.exports.boot = require('./jasmine-core/node_boot.js');
|
3
|
+
|
4
|
+
module.exports.files = (function() {
|
5
|
+
var path = require('path'),
|
6
|
+
fs = require('fs'),
|
7
|
+
glob = require('glob');
|
8
|
+
|
9
|
+
var rootPath = path.join(__dirname, "jasmine-core"),
|
10
|
+
bootFiles = ['boot.js'],
|
11
|
+
nodeBootFiles = ['node_boot.js'];
|
12
|
+
|
13
|
+
var cssFiles = glob.sync(path.join(rootPath, '*.css')).map(path.basename);
|
14
|
+
var jsFiles = glob.sync(path.join(rootPath, '*.js')).map(path.basename);
|
15
|
+
|
16
|
+
['jasmine.js'].concat(bootFiles, nodeBootFiles).forEach(function(file) {
|
17
|
+
jsFiles.splice(jsFiles.indexOf(file), 1);
|
18
|
+
});
|
19
|
+
|
20
|
+
return {
|
21
|
+
path: rootPath,
|
22
|
+
bootDir: rootPath,
|
23
|
+
bootFiles: bootFiles,
|
24
|
+
nodeBootFiles: nodeBootFiles,
|
25
|
+
cssFiles: cssFiles,
|
26
|
+
jsFiles: ['jasmine.js'].concat(jsFiles),
|
27
|
+
imagesDir: path.join(__dirname, '../images')
|
28
|
+
};
|
29
|
+
}());
|
data/lib/jasmine-core/boot.js
CHANGED
@@ -54,47 +54,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
54
54
|
*
|
55
55
|
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
56
56
|
*/
|
57
|
-
var jasmineInterface =
|
58
|
-
describe: function(description, specDefinitions) {
|
59
|
-
return env.describe(description, specDefinitions);
|
60
|
-
},
|
61
|
-
|
62
|
-
xdescribe: function(description, specDefinitions) {
|
63
|
-
return env.xdescribe(description, specDefinitions);
|
64
|
-
},
|
65
|
-
|
66
|
-
it: function(desc, func) {
|
67
|
-
return env.it(desc, func);
|
68
|
-
},
|
69
|
-
|
70
|
-
xit: function(desc, func) {
|
71
|
-
return env.xit(desc, func);
|
72
|
-
},
|
73
|
-
|
74
|
-
beforeEach: function(beforeEachFunction) {
|
75
|
-
return env.beforeEach(beforeEachFunction);
|
76
|
-
},
|
77
|
-
|
78
|
-
afterEach: function(afterEachFunction) {
|
79
|
-
return env.afterEach(afterEachFunction);
|
80
|
-
},
|
81
|
-
|
82
|
-
expect: function(actual) {
|
83
|
-
return env.expect(actual);
|
84
|
-
},
|
85
|
-
|
86
|
-
pending: function() {
|
87
|
-
return env.pending();
|
88
|
-
},
|
89
|
-
|
90
|
-
spyOn: function(obj, methodName) {
|
91
|
-
return env.spyOn(obj, methodName);
|
92
|
-
},
|
93
|
-
|
94
|
-
jsApiReporter: new jasmine.JsApiReporter({
|
95
|
-
timer: new jasmine.Timer()
|
96
|
-
})
|
97
|
-
};
|
57
|
+
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
98
58
|
|
99
59
|
/**
|
100
60
|
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
@@ -105,27 +65,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
105
65
|
extend(window, jasmineInterface);
|
106
66
|
}
|
107
67
|
|
108
|
-
/**
|
109
|
-
* Expose the interface for adding custom equality testers.
|
110
|
-
*/
|
111
|
-
jasmine.addCustomEqualityTester = function(tester) {
|
112
|
-
env.addCustomEqualityTester(tester);
|
113
|
-
};
|
114
|
-
|
115
|
-
/**
|
116
|
-
* Expose the interface for adding custom expectation matchers
|
117
|
-
*/
|
118
|
-
jasmine.addMatchers = function(matchers) {
|
119
|
-
return env.addMatchers(matchers);
|
120
|
-
};
|
121
|
-
|
122
|
-
/**
|
123
|
-
* Expose the mock interface for the JavaScript timeout functions
|
124
|
-
*/
|
125
|
-
jasmine.clock = function() {
|
126
|
-
return env.clock;
|
127
|
-
};
|
128
|
-
|
129
68
|
/**
|
130
69
|
* ## Runner Parameters
|
131
70
|
*
|
@@ -32,47 +32,7 @@
|
|
32
32
|
*
|
33
33
|
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
34
34
|
*/
|
35
|
-
var jasmineInterface =
|
36
|
-
describe: function(description, specDefinitions) {
|
37
|
-
return env.describe(description, specDefinitions);
|
38
|
-
},
|
39
|
-
|
40
|
-
xdescribe: function(description, specDefinitions) {
|
41
|
-
return env.xdescribe(description, specDefinitions);
|
42
|
-
},
|
43
|
-
|
44
|
-
it: function(desc, func) {
|
45
|
-
return env.it(desc, func);
|
46
|
-
},
|
47
|
-
|
48
|
-
xit: function(desc, func) {
|
49
|
-
return env.xit(desc, func);
|
50
|
-
},
|
51
|
-
|
52
|
-
beforeEach: function(beforeEachFunction) {
|
53
|
-
return env.beforeEach(beforeEachFunction);
|
54
|
-
},
|
55
|
-
|
56
|
-
afterEach: function(afterEachFunction) {
|
57
|
-
return env.afterEach(afterEachFunction);
|
58
|
-
},
|
59
|
-
|
60
|
-
expect: function(actual) {
|
61
|
-
return env.expect(actual);
|
62
|
-
},
|
63
|
-
|
64
|
-
pending: function() {
|
65
|
-
return env.pending();
|
66
|
-
},
|
67
|
-
|
68
|
-
spyOn: function(obj, methodName) {
|
69
|
-
return env.spyOn(obj, methodName);
|
70
|
-
},
|
71
|
-
|
72
|
-
jsApiReporter: new jasmine.JsApiReporter({
|
73
|
-
timer: new jasmine.Timer()
|
74
|
-
})
|
75
|
-
};
|
35
|
+
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
76
36
|
|
77
37
|
/**
|
78
38
|
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
@@ -83,27 +43,6 @@
|
|
83
43
|
extend(window, jasmineInterface);
|
84
44
|
}
|
85
45
|
|
86
|
-
/**
|
87
|
-
* Expose the interface for adding custom equality testers.
|
88
|
-
*/
|
89
|
-
jasmine.addCustomEqualityTester = function(tester) {
|
90
|
-
env.addCustomEqualityTester(tester);
|
91
|
-
};
|
92
|
-
|
93
|
-
/**
|
94
|
-
* Expose the interface for adding custom expectation matchers
|
95
|
-
*/
|
96
|
-
jasmine.addMatchers = function(matchers) {
|
97
|
-
return env.addMatchers(matchers);
|
98
|
-
};
|
99
|
-
|
100
|
-
/**
|
101
|
-
* Expose the mock interface for the JavaScript timeout functions
|
102
|
-
*/
|
103
|
-
jasmine.clock = function() {
|
104
|
-
return env.clock;
|
105
|
-
};
|
106
|
-
|
107
46
|
/**
|
108
47
|
* ## Runner Parameters
|
109
48
|
*
|
@@ -6,66 +6,14 @@ module.exports = function(jasmineRequire) {
|
|
6
6
|
|
7
7
|
var env = jasmine.getEnv();
|
8
8
|
|
9
|
-
var jasmineInterface =
|
10
|
-
describe: function(description, specDefinitions) {
|
11
|
-
return env.describe(description, specDefinitions);
|
12
|
-
},
|
13
|
-
|
14
|
-
xdescribe: function(description, specDefinitions) {
|
15
|
-
return env.xdescribe(description, specDefinitions);
|
16
|
-
},
|
17
|
-
|
18
|
-
it: function(desc, func) {
|
19
|
-
return env.it(desc, func);
|
20
|
-
},
|
21
|
-
|
22
|
-
xit: function(desc, func) {
|
23
|
-
return env.xit(desc, func);
|
24
|
-
},
|
25
|
-
|
26
|
-
beforeEach: function(beforeEachFunction) {
|
27
|
-
return env.beforeEach(beforeEachFunction);
|
28
|
-
},
|
29
|
-
|
30
|
-
afterEach: function(afterEachFunction) {
|
31
|
-
return env.afterEach(afterEachFunction);
|
32
|
-
},
|
33
|
-
|
34
|
-
expect: function(actual) {
|
35
|
-
return env.expect(actual);
|
36
|
-
},
|
37
|
-
|
38
|
-
spyOn: function(obj, methodName) {
|
39
|
-
return env.spyOn(obj, methodName);
|
40
|
-
},
|
41
|
-
|
42
|
-
jsApiReporter: new jasmine.JsApiReporter({
|
43
|
-
timer: new jasmine.Timer()
|
44
|
-
}),
|
45
|
-
|
46
|
-
|
47
|
-
jasmine: jasmine
|
48
|
-
};
|
9
|
+
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
49
10
|
|
50
11
|
extend(global, jasmineInterface);
|
51
12
|
|
52
|
-
jasmine.addCustomEqualityTester = function(tester) {
|
53
|
-
env.addCustomEqualityTester(tester);
|
54
|
-
};
|
55
|
-
|
56
|
-
jasmine.addMatchers = function(matchers) {
|
57
|
-
return env.addMatchers(matchers);
|
58
|
-
};
|
59
|
-
|
60
|
-
jasmine.clock = function() {
|
61
|
-
return env.clock;
|
62
|
-
};
|
63
|
-
|
64
13
|
function extend(destination, source) {
|
65
14
|
for (var property in source) destination[property] = source[property];
|
66
15
|
return destination;
|
67
16
|
}
|
68
17
|
|
69
|
-
|
70
18
|
return jasmine;
|
71
19
|
};
|
@@ -23,6 +23,8 @@ body { overflow-y: scroll; }
|
|
23
23
|
.jasmine_html-reporter .symbol-summary li.disabled:before { color: #bababa; content: "\02022"; }
|
24
24
|
.jasmine_html-reporter .symbol-summary li.pending { line-height: 17px; }
|
25
25
|
.jasmine_html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; }
|
26
|
+
.jasmine_html-reporter .symbol-summary li.empty { font-size: 14px; }
|
27
|
+
.jasmine_html-reporter .symbol-summary li.empty:before { color: #ba9d37; content: "\02022"; }
|
26
28
|
.jasmine_html-reporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
|
27
29
|
.jasmine_html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
28
30
|
.jasmine_html-reporter .bar.failed { background-color: #ca3a11; }
|
data/lib/jasmine-core/jasmine.js
CHANGED
@@ -1352,11 +1352,26 @@ getJasmineRequireObj().MockDate = function() {
|
|
1352
1352
|
return self;
|
1353
1353
|
|
1354
1354
|
function FakeDate() {
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1355
|
+
switch(arguments.length) {
|
1356
|
+
case 0:
|
1357
|
+
return new GlobalDate(currentTime);
|
1358
|
+
case 1:
|
1359
|
+
return new GlobalDate(arguments[0]);
|
1360
|
+
case 2:
|
1361
|
+
return new GlobalDate(arguments[0], arguments[1]);
|
1362
|
+
case 3:
|
1363
|
+
return new GlobalDate(arguments[0], arguments[1], arguments[2]);
|
1364
|
+
case 4:
|
1365
|
+
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]);
|
1366
|
+
case 5:
|
1367
|
+
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
1368
|
+
arguments[4]);
|
1369
|
+
case 6:
|
1370
|
+
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
1371
|
+
arguments[4], arguments[5]);
|
1372
|
+
case 7:
|
1373
|
+
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
1374
|
+
arguments[4], arguments[5], arguments[6]);
|
1360
1375
|
}
|
1361
1376
|
}
|
1362
1377
|
|
@@ -1771,6 +1786,7 @@ getJasmineRequireObj().Suite = function() {
|
|
1771
1786
|
|
1772
1787
|
Suite.prototype.disable = function() {
|
1773
1788
|
this.disabled = true;
|
1789
|
+
this.result.status = 'disabled';
|
1774
1790
|
};
|
1775
1791
|
|
1776
1792
|
Suite.prototype.beforeEach = function(fn) {
|
@@ -1787,6 +1803,9 @@ getJasmineRequireObj().Suite = function() {
|
|
1787
1803
|
|
1788
1804
|
Suite.prototype.execute = function(onComplete) {
|
1789
1805
|
var self = this;
|
1806
|
+
|
1807
|
+
this.onStart(this);
|
1808
|
+
|
1790
1809
|
if (this.disabled) {
|
1791
1810
|
complete();
|
1792
1811
|
return;
|
@@ -1798,8 +1817,6 @@ getJasmineRequireObj().Suite = function() {
|
|
1798
1817
|
allFns.push(wrapChildAsAsync(this.children[i]));
|
1799
1818
|
}
|
1800
1819
|
|
1801
|
-
this.onStart(this);
|
1802
|
-
|
1803
1820
|
this.queueRunner({
|
1804
1821
|
fns: allFns,
|
1805
1822
|
onComplete: complete
|
@@ -2511,6 +2528,66 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|
2511
2528
|
return toThrowError;
|
2512
2529
|
};
|
2513
2530
|
|
2531
|
+
getJasmineRequireObj().interface = function(jasmine, env) {
|
2532
|
+
var jasmineInterface = {
|
2533
|
+
describe: function(description, specDefinitions) {
|
2534
|
+
return env.describe(description, specDefinitions);
|
2535
|
+
},
|
2536
|
+
|
2537
|
+
xdescribe: function(description, specDefinitions) {
|
2538
|
+
return env.xdescribe(description, specDefinitions);
|
2539
|
+
},
|
2540
|
+
|
2541
|
+
it: function(desc, func) {
|
2542
|
+
return env.it(desc, func);
|
2543
|
+
},
|
2544
|
+
|
2545
|
+
xit: function(desc, func) {
|
2546
|
+
return env.xit(desc, func);
|
2547
|
+
},
|
2548
|
+
|
2549
|
+
beforeEach: function(beforeEachFunction) {
|
2550
|
+
return env.beforeEach(beforeEachFunction);
|
2551
|
+
},
|
2552
|
+
|
2553
|
+
afterEach: function(afterEachFunction) {
|
2554
|
+
return env.afterEach(afterEachFunction);
|
2555
|
+
},
|
2556
|
+
|
2557
|
+
expect: function(actual) {
|
2558
|
+
return env.expect(actual);
|
2559
|
+
},
|
2560
|
+
|
2561
|
+
pending: function() {
|
2562
|
+
return env.pending();
|
2563
|
+
},
|
2564
|
+
|
2565
|
+
spyOn: function(obj, methodName) {
|
2566
|
+
return env.spyOn(obj, methodName);
|
2567
|
+
},
|
2568
|
+
|
2569
|
+
jsApiReporter: new jasmine.JsApiReporter({
|
2570
|
+
timer: new jasmine.Timer()
|
2571
|
+
}),
|
2572
|
+
|
2573
|
+
jasmine: jasmine
|
2574
|
+
};
|
2575
|
+
|
2576
|
+
jasmine.addCustomEqualityTester = function(tester) {
|
2577
|
+
env.addCustomEqualityTester(tester);
|
2578
|
+
};
|
2579
|
+
|
2580
|
+
jasmine.addMatchers = function(matchers) {
|
2581
|
+
return env.addMatchers(matchers);
|
2582
|
+
};
|
2583
|
+
|
2584
|
+
jasmine.clock = function() {
|
2585
|
+
return env.clock;
|
2586
|
+
};
|
2587
|
+
|
2588
|
+
return jasmineInterface;
|
2589
|
+
};
|
2590
|
+
|
2514
2591
|
getJasmineRequireObj().version = function() {
|
2515
|
-
return '2.0.
|
2592
|
+
return '2.0.2';
|
2516
2593
|
};
|
@@ -28,66 +28,14 @@ module.exports = function(jasmineRequire) {
|
|
28
28
|
|
29
29
|
var env = jasmine.getEnv();
|
30
30
|
|
31
|
-
var jasmineInterface =
|
32
|
-
describe: function(description, specDefinitions) {
|
33
|
-
return env.describe(description, specDefinitions);
|
34
|
-
},
|
35
|
-
|
36
|
-
xdescribe: function(description, specDefinitions) {
|
37
|
-
return env.xdescribe(description, specDefinitions);
|
38
|
-
},
|
39
|
-
|
40
|
-
it: function(desc, func) {
|
41
|
-
return env.it(desc, func);
|
42
|
-
},
|
43
|
-
|
44
|
-
xit: function(desc, func) {
|
45
|
-
return env.xit(desc, func);
|
46
|
-
},
|
47
|
-
|
48
|
-
beforeEach: function(beforeEachFunction) {
|
49
|
-
return env.beforeEach(beforeEachFunction);
|
50
|
-
},
|
51
|
-
|
52
|
-
afterEach: function(afterEachFunction) {
|
53
|
-
return env.afterEach(afterEachFunction);
|
54
|
-
},
|
55
|
-
|
56
|
-
expect: function(actual) {
|
57
|
-
return env.expect(actual);
|
58
|
-
},
|
59
|
-
|
60
|
-
spyOn: function(obj, methodName) {
|
61
|
-
return env.spyOn(obj, methodName);
|
62
|
-
},
|
63
|
-
|
64
|
-
jsApiReporter: new jasmine.JsApiReporter({
|
65
|
-
timer: new jasmine.Timer()
|
66
|
-
}),
|
67
|
-
|
68
|
-
|
69
|
-
jasmine: jasmine
|
70
|
-
};
|
31
|
+
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
71
32
|
|
72
33
|
extend(global, jasmineInterface);
|
73
34
|
|
74
|
-
jasmine.addCustomEqualityTester = function(tester) {
|
75
|
-
env.addCustomEqualityTester(tester);
|
76
|
-
};
|
77
|
-
|
78
|
-
jasmine.addMatchers = function(matchers) {
|
79
|
-
return env.addMatchers(matchers);
|
80
|
-
};
|
81
|
-
|
82
|
-
jasmine.clock = function() {
|
83
|
-
return env.clock;
|
84
|
-
};
|
85
|
-
|
86
35
|
function extend(destination, source) {
|
87
36
|
for (var property in source) destination[property] = source[property];
|
88
37
|
return destination;
|
89
38
|
}
|
90
39
|
|
91
|
-
|
92
40
|
return jasmine;
|
93
41
|
};
|
@@ -157,15 +157,35 @@ describe("FakeDate", function() {
|
|
157
157
|
expect(fakeGlobal.Date.now()).toEqual(1000);
|
158
158
|
});
|
159
159
|
|
160
|
-
it("allows
|
160
|
+
it("allows creation of a Date in a different time than the mocked time", function() {
|
161
161
|
var fakeGlobal = { Date: Date },
|
162
|
-
mockDate = new j$.MockDate(fakeGlobal)
|
163
|
-
baseDate = new Date(2013, 9, 23, 0, 0, 0, 0);
|
162
|
+
mockDate = new j$.MockDate(fakeGlobal);
|
164
163
|
|
165
|
-
mockDate.install(
|
164
|
+
mockDate.install();
|
166
165
|
|
167
166
|
var otherDate = new fakeGlobal.Date(2013, 9, 23, 0, 0, 1, 0);
|
168
|
-
expect(otherDate.getTime()).
|
167
|
+
expect(otherDate.getTime()).toEqual(new Date(2013, 9, 23, 0, 0, 1, 0).getTime());
|
168
|
+
});
|
169
|
+
|
170
|
+
it("allows creation of a Date that isn't fully specified", function() {
|
171
|
+
var fakeGlobal = { Date: Date },
|
172
|
+
mockDate = new j$.MockDate(fakeGlobal);
|
173
|
+
|
174
|
+
mockDate.install();
|
175
|
+
|
176
|
+
var otherDate = new fakeGlobal.Date(2013, 9, 23);
|
177
|
+
expect(otherDate.getTime()).toEqual(new Date(2013, 9, 23).getTime());
|
178
|
+
});
|
179
|
+
|
180
|
+
it('allows creation of a Date with millis', function() {
|
181
|
+
var fakeGlobal = { Date: Date },
|
182
|
+
mockDate = new j$.MockDate(fakeGlobal),
|
183
|
+
now = new Date(2014, 3, 15).getTime();
|
184
|
+
|
185
|
+
mockDate.install();
|
186
|
+
|
187
|
+
var otherDate = new fakeGlobal.Date(now);
|
188
|
+
expect(otherDate.getTime()).toEqual(now);
|
169
189
|
});
|
170
190
|
|
171
191
|
it("copies all Date properties to the mocked date", function() {
|
@@ -67,12 +67,17 @@ describe("Suite", function() {
|
|
67
67
|
expect(suite.afterFns).toEqual([innerAfter, outerAfter]);
|
68
68
|
});
|
69
69
|
|
70
|
-
it("can be disabled", function() {
|
70
|
+
it("can be disabled, but still calls callbacks", function() {
|
71
71
|
var env = new j$.Env(),
|
72
72
|
fakeQueueRunner = jasmine.createSpy('fake queue runner'),
|
73
|
+
onStart = jasmine.createSpy('onStart'),
|
74
|
+
resultCallback = jasmine.createSpy('resultCallback'),
|
75
|
+
onComplete = jasmine.createSpy('onComplete'),
|
73
76
|
suite = new j$.Suite({
|
74
77
|
env: env,
|
75
78
|
description: "with a child suite",
|
79
|
+
onStart: onStart,
|
80
|
+
resultCallback: resultCallback,
|
76
81
|
queueRunner: fakeQueueRunner
|
77
82
|
});
|
78
83
|
|
@@ -80,9 +85,12 @@ describe("Suite", function() {
|
|
80
85
|
|
81
86
|
expect(suite.disabled).toBe(true);
|
82
87
|
|
83
|
-
suite.execute();
|
88
|
+
suite.execute(onComplete);
|
84
89
|
|
85
90
|
expect(fakeQueueRunner).not.toHaveBeenCalled();
|
91
|
+
expect(onStart).toHaveBeenCalled();
|
92
|
+
expect(resultCallback).toHaveBeenCalled();
|
93
|
+
expect(onComplete).toHaveBeenCalled();
|
86
94
|
});
|
87
95
|
|
88
96
|
it("delegates execution of its specs and suites", function() {
|
@@ -179,4 +187,30 @@ describe("Suite", function() {
|
|
179
187
|
fullName: "with a child suite"
|
180
188
|
});
|
181
189
|
});
|
190
|
+
|
191
|
+
it("calls a provided result callback with status being disabled when disabled and done", function() {
|
192
|
+
var env = new j$.Env(),
|
193
|
+
suiteResultsCallback = jasmine.createSpy('suite result callback'),
|
194
|
+
fakeQueueRunner = function(attrs) { attrs.onComplete(); },
|
195
|
+
suite = new j$.Suite({
|
196
|
+
env: env,
|
197
|
+
description: "with a child suite",
|
198
|
+
queueRunner: fakeQueueRunner,
|
199
|
+
resultCallback: suiteResultsCallback
|
200
|
+
}),
|
201
|
+
fakeSpec1 = {
|
202
|
+
execute: jasmine.createSpy('fakeSpec1')
|
203
|
+
};
|
204
|
+
|
205
|
+
suite.disable();
|
206
|
+
|
207
|
+
suite.execute();
|
208
|
+
|
209
|
+
expect(suiteResultsCallback).toHaveBeenCalledWith({
|
210
|
+
id: suite.id,
|
211
|
+
status: 'disabled',
|
212
|
+
description: "with a child suite",
|
213
|
+
fullName: "with a child suite"
|
214
|
+
});
|
215
|
+
});
|
182
216
|
});
|
data/lib/jasmine-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajan Agaskar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-08-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -76,12 +76,10 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ./lib/console/console.js
|
79
|
-
- ./lib/jasmine-core.js
|
80
|
-
- ./lib/jasmine-core.rb
|
81
79
|
- ./lib/jasmine-core/__init__.py
|
82
|
-
- ./lib/jasmine-core/boot.js
|
83
80
|
- ./lib/jasmine-core/boot/boot.js
|
84
81
|
- ./lib/jasmine-core/boot/node_boot.js
|
82
|
+
- ./lib/jasmine-core/boot.js
|
85
83
|
- ./lib/jasmine-core/core.py
|
86
84
|
- ./lib/jasmine-core/example/node_example/spec/PlayerSpec.js
|
87
85
|
- ./lib/jasmine-core/example/node_example/spec/SpecHelper.js
|
@@ -96,6 +94,9 @@ files:
|
|
96
94
|
- ./lib/jasmine-core/jasmine.js
|
97
95
|
- ./lib/jasmine-core/json2.js
|
98
96
|
- ./lib/jasmine-core/node_boot.js
|
97
|
+
- ./lib/jasmine-core/version.rb
|
98
|
+
- ./lib/jasmine-core.js
|
99
|
+
- ./lib/jasmine-core.rb
|
99
100
|
- ./lib/jasmine-core/spec/console/ConsoleReporterSpec.js
|
100
101
|
- ./lib/jasmine-core/spec/core/AnySpec.js
|
101
102
|
- ./lib/jasmine-core/spec/core/CallTrackerSpec.js
|
@@ -106,21 +107,10 @@ files:
|
|
106
107
|
- ./lib/jasmine-core/spec/core/ExceptionsSpec.js
|
107
108
|
- ./lib/jasmine-core/spec/core/ExpectationResultSpec.js
|
108
109
|
- ./lib/jasmine-core/spec/core/ExpectationSpec.js
|
109
|
-
- ./lib/jasmine-core/spec/core/JsApiReporterSpec.js
|
110
|
-
- ./lib/jasmine-core/spec/core/MockDateSpec.js
|
111
|
-
- ./lib/jasmine-core/spec/core/ObjectContainingSpec.js
|
112
|
-
- ./lib/jasmine-core/spec/core/PrettyPrintSpec.js
|
113
|
-
- ./lib/jasmine-core/spec/core/QueueRunnerSpec.js
|
114
|
-
- ./lib/jasmine-core/spec/core/ReportDispatcherSpec.js
|
115
|
-
- ./lib/jasmine-core/spec/core/SpecSpec.js
|
116
|
-
- ./lib/jasmine-core/spec/core/SpySpec.js
|
117
|
-
- ./lib/jasmine-core/spec/core/SpyStrategySpec.js
|
118
|
-
- ./lib/jasmine-core/spec/core/SuiteSpec.js
|
119
|
-
- ./lib/jasmine-core/spec/core/TimerSpec.js
|
120
|
-
- ./lib/jasmine-core/spec/core/UtilSpec.js
|
121
110
|
- ./lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js
|
122
111
|
- ./lib/jasmine-core/spec/core/integration/EnvSpec.js
|
123
112
|
- ./lib/jasmine-core/spec/core/integration/SpecRunningSpec.js
|
113
|
+
- ./lib/jasmine-core/spec/core/JsApiReporterSpec.js
|
124
114
|
- ./lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js
|
125
115
|
- ./lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js
|
126
116
|
- ./lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js
|
@@ -139,6 +129,17 @@ files:
|
|
139
129
|
- ./lib/jasmine-core/spec/core/matchers/toMatchSpec.js
|
140
130
|
- ./lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js
|
141
131
|
- ./lib/jasmine-core/spec/core/matchers/toThrowSpec.js
|
132
|
+
- ./lib/jasmine-core/spec/core/MockDateSpec.js
|
133
|
+
- ./lib/jasmine-core/spec/core/ObjectContainingSpec.js
|
134
|
+
- ./lib/jasmine-core/spec/core/PrettyPrintSpec.js
|
135
|
+
- ./lib/jasmine-core/spec/core/QueueRunnerSpec.js
|
136
|
+
- ./lib/jasmine-core/spec/core/ReportDispatcherSpec.js
|
137
|
+
- ./lib/jasmine-core/spec/core/SpecSpec.js
|
138
|
+
- ./lib/jasmine-core/spec/core/SpySpec.js
|
139
|
+
- ./lib/jasmine-core/spec/core/SpyStrategySpec.js
|
140
|
+
- ./lib/jasmine-core/spec/core/SuiteSpec.js
|
141
|
+
- ./lib/jasmine-core/spec/core/TimerSpec.js
|
142
|
+
- ./lib/jasmine-core/spec/core/UtilSpec.js
|
142
143
|
- ./lib/jasmine-core/spec/helpers/BrowserFlags.js
|
143
144
|
- ./lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js
|
144
145
|
- ./lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js
|
@@ -150,7 +151,6 @@ files:
|
|
150
151
|
- ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
|
151
152
|
- ./lib/jasmine-core/spec/performance/large_object_test.js
|
152
153
|
- ./lib/jasmine-core/spec/performance/performance_test.js
|
153
|
-
- ./lib/jasmine-core/version.rb
|
154
154
|
homepage: http://pivotal.github.com/jasmine
|
155
155
|
licenses:
|
156
156
|
- MIT
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project: jasmine-core
|
174
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.0.3
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: JavaScript BDD framework
|