evergreen 0.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +101 -3
- data/bin/evergreen +2 -2
- data/lib/evergreen.rb +14 -2
- data/lib/evergreen/evergreen.js +23 -0
- data/lib/evergreen/rails.rb +8 -0
- data/lib/evergreen/runner.rb +21 -14
- data/lib/evergreen/spec.rb +12 -33
- data/lib/evergreen/version.rb +1 -1
- data/lib/evergreen/views/list.erb +1 -1
- data/lib/evergreen/views/spec.erb +9 -22
- data/lib/jasmine/README.markdown +21 -28
- data/lib/jasmine/Rakefile +98 -68
- data/lib/jasmine/example/SpecRunner.html +27 -0
- data/lib/jasmine/example/spec/PlayerSpec.js +58 -0
- data/lib/jasmine/example/spec/SpecHelper.js +9 -0
- data/lib/jasmine/example/src/Player.js +22 -0
- data/lib/jasmine/example/src/Song.js +7 -0
- data/lib/jasmine/lib/jasmine-html.js +182 -0
- data/lib/jasmine/lib/{jasmine-0.10.4.js → jasmine.js} +127 -155
- data/lib/jasmine/spec/runner.html +4 -3
- data/lib/jasmine/spec/suites/BaseSpec.js +27 -0
- data/lib/jasmine/spec/suites/CustomMatchersSpec.js +0 -24
- data/lib/jasmine/spec/suites/EnvSpec.js +1 -1
- data/lib/jasmine/spec/suites/JsApiReporterSpec.js +16 -9
- data/lib/jasmine/spec/suites/MatchersSpec.js +49 -42
- data/lib/jasmine/spec/suites/MockClockSpec.js +4 -0
- data/lib/jasmine/spec/suites/MultiReporterSpec.js +23 -8
- data/lib/jasmine/spec/suites/PrettyPrintSpec.js +2 -2
- data/lib/jasmine/spec/suites/ReporterSpec.js +10 -14
- data/lib/jasmine/spec/suites/RunnerSpec.js +6 -6
- data/lib/jasmine/spec/suites/SpecRunningSpec.js +1 -1
- data/lib/jasmine/spec/suites/SpecSpec.js +15 -1
- data/lib/jasmine/spec/suites/SpySpec.js +3 -3
- data/lib/jasmine/spec/suites/TrivialReporterSpec.js +91 -14
- data/lib/jasmine/spec/suites/WaitsForBlockSpec.js +5 -6
- data/lib/jasmine/src/JsApiReporter.js +4 -6
- data/lib/jasmine/src/Matchers.js +19 -19
- data/lib/jasmine/src/MultiReporter.js +8 -1
- data/lib/jasmine/src/NestedResults.js +5 -5
- data/lib/jasmine/src/PrettyPrinter.js +2 -2
- data/lib/jasmine/src/Reporter.js +4 -0
- data/lib/jasmine/src/Spec.js +12 -8
- data/lib/jasmine/src/base.js +40 -44
- data/lib/jasmine/{lib → src/html}/TrivialReporter.js +17 -6
- data/lib/jasmine/src/html/jasmine.css +166 -0
- data/lib/jasmine/src/mock-timeout.js +22 -16
- data/lib/jasmine/src/version.json +2 -2
- data/lib/tasks/evergreen.rake +7 -0
- data/spec/evergreen_spec.rb +18 -0
- data/spec/fixtures/public/jquery.js +152 -0
- data/spec/fixtures/spec/javascripts/bar_spec.js +0 -0
- data/spec/fixtures/spec/javascripts/failing_spec.js +12 -0
- data/spec/fixtures/spec/javascripts/foo_spec.js +0 -0
- data/spec/fixtures/spec/javascripts/templates_spec.html +1 -0
- data/spec/fixtures/spec/javascripts/templates_spec.js +23 -0
- data/spec/fixtures/spec/javascripts/testing_spec.js +11 -0
- data/spec/fixtures/spec/javascripts/transactions_spec.js +14 -0
- data/spec/meta_spec.rb +17 -0
- data/spec/runner_spec.rb +35 -0
- data/spec/spec_helper.rb +33 -0
- data/spec/spec_spec.rb +30 -0
- metadata +64 -48
- data/lib/jasmine/doc/files.html +0 -460
- data/lib/jasmine/doc/index.html +0 -322
- data/lib/jasmine/doc/symbols/_global_.html +0 -918
- data/lib/jasmine/doc/symbols/jasmine.Block.html +0 -417
- data/lib/jasmine/doc/symbols/jasmine.Clock.html +0 -678
- data/lib/jasmine/doc/symbols/jasmine.Env.html +0 -1169
- data/lib/jasmine/doc/symbols/jasmine.JsApiReporter.html +0 -822
- data/lib/jasmine/doc/symbols/jasmine.Matchers.html +0 -1474
- data/lib/jasmine/doc/symbols/jasmine.MultiReporter.html +0 -394
- data/lib/jasmine/doc/symbols/jasmine.NestedResults.html +0 -710
- data/lib/jasmine/doc/symbols/jasmine.Reporter.html +0 -574
- data/lib/jasmine/doc/symbols/jasmine.Runner.html +0 -710
- data/lib/jasmine/doc/symbols/jasmine.Spec.html +0 -1253
- data/lib/jasmine/doc/symbols/jasmine.Spy.html +0 -855
- data/lib/jasmine/doc/symbols/jasmine.Suite.html +0 -705
- data/lib/jasmine/doc/symbols/jasmine.html +0 -1345
- data/lib/jasmine/doc/symbols/jasmine.util.html +0 -535
- data/lib/jasmine/doc/symbols/src/lib_TrivialReporter.js.html +0 -124
- data/lib/jasmine/doc/symbols/src/src_Block.js.html +0 -29
- data/lib/jasmine/doc/symbols/src/src_Env.js.html +0 -248
- data/lib/jasmine/doc/symbols/src/src_JsApiReporter.js.html +0 -111
- data/lib/jasmine/doc/symbols/src/src_Matchers.js.html +0 -344
- data/lib/jasmine/doc/symbols/src/src_MultiReporter.js.html +0 -36
- data/lib/jasmine/doc/symbols/src/src_NestedResults.js.html +0 -88
- data/lib/jasmine/doc/symbols/src/src_PrettyPrinter.js.html +0 -130
- data/lib/jasmine/doc/symbols/src/src_Queue.js.html +0 -102
- data/lib/jasmine/doc/symbols/src/src_Reporter.js.html +0 -35
- data/lib/jasmine/doc/symbols/src/src_Reporters.js.html +0 -51
- data/lib/jasmine/doc/symbols/src/src_Runner.js.html +0 -75
- data/lib/jasmine/doc/symbols/src/src_Spec.js.html +0 -214
- data/lib/jasmine/doc/symbols/src/src_Suite.js.html +0 -77
- data/lib/jasmine/doc/symbols/src/src_WaitsBlock.js.html +0 -21
- data/lib/jasmine/doc/symbols/src/src_WaitsForBlock.js.html +0 -45
- data/lib/jasmine/doc/symbols/src/src_base.js.html +0 -585
- data/lib/jasmine/doc/symbols/src/src_mock-timeout.js.html +0 -185
- data/lib/jasmine/doc/symbols/src/src_util.js.html +0 -75
- data/lib/jasmine/example/example_runner.html +0 -22
- data/lib/jasmine/example/spec/example_suite.js +0 -11
- data/lib/jasmine/spec/jasmine_helper.rb +0 -44
- data/lib/jasmine/spec/jasmine_spec.rb +0 -31
- data/lib/jasmine/spec/saucelabs.yml +0 -24
- data/lib/jasmine/src/Reporters.js +0 -43
@@ -26,6 +26,14 @@ jasmine.undefined = jasmine.___undefined___;
|
|
26
26
|
*/
|
27
27
|
jasmine.DEFAULT_UPDATE_INTERVAL = 250;
|
28
28
|
|
29
|
+
jasmine.getGlobal = function() {
|
30
|
+
function getGlobal() {
|
31
|
+
return this;
|
32
|
+
}
|
33
|
+
|
34
|
+
return getGlobal();
|
35
|
+
};
|
36
|
+
|
29
37
|
/**
|
30
38
|
* Allows for bound functions to be compared. Internal use only.
|
31
39
|
*
|
@@ -42,35 +50,41 @@ jasmine.bindOriginal_ = function(base, name) {
|
|
42
50
|
};
|
43
51
|
} else {
|
44
52
|
// IE support
|
45
|
-
return
|
53
|
+
return jasmine.getGlobal()[name];
|
46
54
|
}
|
47
55
|
};
|
48
56
|
|
49
|
-
jasmine.setTimeout = jasmine.bindOriginal_(
|
50
|
-
jasmine.clearTimeout = jasmine.bindOriginal_(
|
51
|
-
jasmine.setInterval = jasmine.bindOriginal_(
|
52
|
-
jasmine.clearInterval = jasmine.bindOriginal_(
|
57
|
+
jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
|
58
|
+
jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
|
59
|
+
jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
|
60
|
+
jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
|
53
61
|
|
54
|
-
jasmine.MessageResult = function(
|
55
|
-
this.type = '
|
56
|
-
this.
|
62
|
+
jasmine.MessageResult = function(values) {
|
63
|
+
this.type = 'log';
|
64
|
+
this.values = values;
|
57
65
|
this.trace = new Error(); // todo: test better
|
58
66
|
};
|
59
67
|
|
60
68
|
jasmine.MessageResult.prototype.toString = function() {
|
61
|
-
|
69
|
+
var text = "";
|
70
|
+
for(var i = 0; i < this.values.length; i++) {
|
71
|
+
if (i > 0) text += " ";
|
72
|
+
if (jasmine.isString_(this.values[i])) {
|
73
|
+
text += this.values[i];
|
74
|
+
} else {
|
75
|
+
text += jasmine.pp(this.values[i]);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
return text;
|
62
79
|
};
|
63
80
|
|
64
81
|
jasmine.ExpectationResult = function(params) {
|
65
|
-
this.type = '
|
82
|
+
this.type = 'expect';
|
66
83
|
this.matcherName = params.matcherName;
|
67
84
|
this.passed_ = params.passed;
|
68
85
|
this.expected = params.expected;
|
69
86
|
this.actual = params.actual;
|
70
87
|
|
71
|
-
/** @deprecated */
|
72
|
-
this.details = params.details;
|
73
|
-
|
74
88
|
this.message = this.passed_ ? 'Passed.' : params.message;
|
75
89
|
this.trace = this.passed_ ? '' : new Error(this.message);
|
76
90
|
};
|
@@ -158,7 +172,7 @@ jasmine.isDomNode = function(obj) {
|
|
158
172
|
*
|
159
173
|
* @example
|
160
174
|
* // don't care about which function is passed in, as long as it's a function
|
161
|
-
* expect(mySpy).
|
175
|
+
* expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
|
162
176
|
*
|
163
177
|
* @param {Class} clazz
|
164
178
|
* @returns matchable object of the type clazz
|
@@ -173,7 +187,8 @@ jasmine.any = function(clazz) {
|
|
173
187
|
* Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
|
174
188
|
* expectation syntax. Spies can be checked if they were called or not and what the calling params were.
|
175
189
|
*
|
176
|
-
* A Spy has the following
|
190
|
+
* A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
|
191
|
+
*
|
177
192
|
* Spies are torn down at the end of every spec.
|
178
193
|
*
|
179
194
|
* Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
|
@@ -203,8 +218,8 @@ jasmine.any = function(clazz) {
|
|
203
218
|
*
|
204
219
|
* // mock example
|
205
220
|
* foo.not(7 == 7);
|
206
|
-
* expect(foo.not).
|
207
|
-
* expect(foo.not).
|
221
|
+
* expect(foo.not).toHaveBeenCalled();
|
222
|
+
* expect(foo.not).toHaveBeenCalledWith(true);
|
208
223
|
*
|
209
224
|
* @constructor
|
210
225
|
* @see spyOn, jasmine.createSpy, jasmine.createSpyObj
|
@@ -395,8 +410,14 @@ jasmine.createSpyObj = function(baseName, methodNames) {
|
|
395
410
|
return obj;
|
396
411
|
};
|
397
412
|
|
398
|
-
|
399
|
-
|
413
|
+
/**
|
414
|
+
* All parameters are pretty-printed and concatenated together, then written to the current spec's output.
|
415
|
+
*
|
416
|
+
* Be careful not to leave calls to <code>jasmine.log</code> in production code.
|
417
|
+
*/
|
418
|
+
jasmine.log = function() {
|
419
|
+
var spec = jasmine.getEnv().currentSpec;
|
420
|
+
spec.log.apply(spec, arguments);
|
400
421
|
};
|
401
422
|
|
402
423
|
/**
|
@@ -559,31 +580,6 @@ jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
|
|
559
580
|
}
|
560
581
|
throw new Error("This browser does not support XMLHttpRequest.");
|
561
582
|
} : XMLHttpRequest;
|
562
|
-
|
563
|
-
/**
|
564
|
-
* Adds suite files to an HTML document so that they are executed, thus adding them to the current
|
565
|
-
* Jasmine environment.
|
566
|
-
*
|
567
|
-
* @param {String} url path to the file to include
|
568
|
-
* @param {Boolean} opt_global
|
569
|
-
* @deprecated We suggest you use a different method of including JS source files. <code>jasmine.include</code> will be removed soon.
|
570
|
-
*/
|
571
|
-
jasmine.include = function(url, opt_global) {
|
572
|
-
if (opt_global) {
|
573
|
-
document.write('<script type="text/javascript" src="' + url + '"></' + 'script>');
|
574
|
-
} else {
|
575
|
-
var xhr;
|
576
|
-
try {
|
577
|
-
xhr = new jasmine.XmlHttpRequest();
|
578
|
-
xhr.open("GET", url, false);
|
579
|
-
xhr.send(null);
|
580
|
-
} catch(e) {
|
581
|
-
throw new Error("couldn't fetch " + url + ": " + e);
|
582
|
-
}
|
583
|
-
|
584
|
-
return eval(xhr.responseText);
|
585
|
-
}
|
586
|
-
};
|
587
583
|
/**
|
588
584
|
* @namespace
|
589
585
|
*/
|
@@ -933,6 +929,10 @@ jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
|
|
933
929
|
jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
|
934
930
|
};
|
935
931
|
|
932
|
+
//noinspection JSUnusedLocalSymbols
|
933
|
+
jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
|
934
|
+
};
|
935
|
+
|
936
936
|
//noinspection JSUnusedLocalSymbols
|
937
937
|
jasmine.Reporter.prototype.reportSpecResults = function(spec) {
|
938
938
|
};
|
@@ -1045,11 +1045,11 @@ jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
|
|
1045
1045
|
|
1046
1046
|
jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
|
1047
1047
|
var summaryMessages = [];
|
1048
|
-
var messagesLength = result.messages.length
|
1048
|
+
var messagesLength = result.messages.length;
|
1049
1049
|
for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
|
1050
1050
|
var resultMessage = result.messages[messageIndex];
|
1051
1051
|
summaryMessages.push({
|
1052
|
-
text: resultMessage.
|
1052
|
+
text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
|
1053
1053
|
passed: resultMessage.passed ? resultMessage.passed() : true,
|
1054
1054
|
type: resultMessage.type,
|
1055
1055
|
message: resultMessage.message,
|
@@ -1057,14 +1057,12 @@ jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
|
|
1057
1057
|
stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
|
1058
1058
|
}
|
1059
1059
|
});
|
1060
|
-
}
|
1060
|
+
}
|
1061
1061
|
|
1062
|
-
|
1062
|
+
return {
|
1063
1063
|
result : result.result,
|
1064
1064
|
messages : summaryMessages
|
1065
1065
|
};
|
1066
|
-
|
1067
|
-
return summaryResult;
|
1068
1066
|
};
|
1069
1067
|
|
1070
1068
|
/**
|
@@ -1084,25 +1082,11 @@ jasmine.Matchers = function(env, actual, spec, opt_isNot) {
|
|
1084
1082
|
// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
|
1085
1083
|
jasmine.Matchers.pp = function(str) {
|
1086
1084
|
throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
|
1087
|
-
this.report();
|
1088
1085
|
};
|
1089
1086
|
|
1090
|
-
|
1087
|
+
// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
|
1091
1088
|
jasmine.Matchers.prototype.report = function(result, failing_message, details) {
|
1092
|
-
|
1093
|
-
|
1094
|
-
if (this.isNot) {
|
1095
|
-
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
this.reportWasCalled_ = true;
|
1099
|
-
var expectationResult = new jasmine.ExpectationResult({
|
1100
|
-
passed: result,
|
1101
|
-
message: failing_message,
|
1102
|
-
details: details
|
1103
|
-
});
|
1104
|
-
this.spec.addMatcherResult(expectationResult);
|
1105
|
-
return result;
|
1089
|
+
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
|
1106
1090
|
};
|
1107
1091
|
|
1108
1092
|
jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
|
@@ -1245,12 +1229,18 @@ jasmine.Matchers.prototype.toBeFalsy = function() {
|
|
1245
1229
|
return !this.actual;
|
1246
1230
|
};
|
1247
1231
|
|
1232
|
+
|
1233
|
+
/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
|
1234
|
+
jasmine.Matchers.prototype.wasCalled = function() {
|
1235
|
+
return this.toHaveBeenCalled();
|
1236
|
+
};
|
1237
|
+
|
1248
1238
|
/**
|
1249
1239
|
* Matcher that checks to see if the actual, a Jasmine spy, was called.
|
1250
1240
|
*/
|
1251
|
-
jasmine.Matchers.prototype.
|
1241
|
+
jasmine.Matchers.prototype.toHaveBeenCalled = function() {
|
1252
1242
|
if (arguments.length > 0) {
|
1253
|
-
throw new Error('
|
1243
|
+
throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
|
1254
1244
|
}
|
1255
1245
|
|
1256
1246
|
if (!jasmine.isSpy(this.actual)) {
|
@@ -1266,6 +1256,8 @@ jasmine.Matchers.prototype.wasCalled = function() {
|
|
1266
1256
|
|
1267
1257
|
/**
|
1268
1258
|
* Matcher that checks to see if the actual, a Jasmine spy, was not called.
|
1259
|
+
*
|
1260
|
+
* @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
|
1269
1261
|
*/
|
1270
1262
|
jasmine.Matchers.prototype.wasNotCalled = function() {
|
1271
1263
|
if (arguments.length > 0) {
|
@@ -1283,13 +1275,18 @@ jasmine.Matchers.prototype.wasNotCalled = function() {
|
|
1283
1275
|
return !this.actual.wasCalled;
|
1284
1276
|
};
|
1285
1277
|
|
1278
|
+
/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
|
1279
|
+
jasmine.Matchers.prototype.wasCalledWith = function() {
|
1280
|
+
return this.toHaveBeenCalledWith.apply(this, arguments);
|
1281
|
+
};
|
1282
|
+
|
1286
1283
|
/**
|
1287
1284
|
* Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
|
1288
1285
|
*
|
1289
1286
|
* @example
|
1290
1287
|
*
|
1291
1288
|
*/
|
1292
|
-
jasmine.Matchers.prototype.
|
1289
|
+
jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
|
1293
1290
|
var expectedArgs = jasmine.util.argsToArray(arguments);
|
1294
1291
|
if (!jasmine.isSpy(this.actual)) {
|
1295
1292
|
throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
|
@@ -1305,6 +1302,7 @@ jasmine.Matchers.prototype.wasCalledWith = function() {
|
|
1305
1302
|
return this.env.contains_(this.actual.argsForCall, expectedArgs);
|
1306
1303
|
};
|
1307
1304
|
|
1305
|
+
/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
|
1308
1306
|
jasmine.Matchers.prototype.wasNotCalledWith = function() {
|
1309
1307
|
var expectedArgs = jasmine.util.argsToArray(arguments);
|
1310
1308
|
if (!jasmine.isSpy(this.actual)) {
|
@@ -1416,7 +1414,14 @@ jasmine.MultiReporter.prototype.addReporter = function(reporter) {
|
|
1416
1414
|
};
|
1417
1415
|
|
1418
1416
|
(function() {
|
1419
|
-
var functionNames = [
|
1417
|
+
var functionNames = [
|
1418
|
+
"reportRunnerStarting",
|
1419
|
+
"reportRunnerResults",
|
1420
|
+
"reportSuiteResults",
|
1421
|
+
"reportSpecStarting",
|
1422
|
+
"reportSpecResults",
|
1423
|
+
"log"
|
1424
|
+
];
|
1420
1425
|
for (var i = 0; i < functionNames.length; i++) {
|
1421
1426
|
var functionName = functionNames[i];
|
1422
1427
|
jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
|
@@ -1471,11 +1476,11 @@ jasmine.NestedResults.prototype.rollupCounts = function(result) {
|
|
1471
1476
|
};
|
1472
1477
|
|
1473
1478
|
/**
|
1474
|
-
*
|
1475
|
-
* @param message
|
1479
|
+
* Adds a log message.
|
1480
|
+
* @param values Array of message parts which will be concatenated later.
|
1476
1481
|
*/
|
1477
|
-
jasmine.NestedResults.prototype.log = function(
|
1478
|
-
this.items_.push(new jasmine.MessageResult(
|
1482
|
+
jasmine.NestedResults.prototype.log = function(values) {
|
1483
|
+
this.items_.push(new jasmine.MessageResult(values));
|
1479
1484
|
};
|
1480
1485
|
|
1481
1486
|
/**
|
@@ -1490,7 +1495,7 @@ jasmine.NestedResults.prototype.getItems = function() {
|
|
1490
1495
|
* @param {jasmine.ExpectationResult|jasmine.NestedResults} result
|
1491
1496
|
*/
|
1492
1497
|
jasmine.NestedResults.prototype.addResult = function(result) {
|
1493
|
-
if (result.type != '
|
1498
|
+
if (result.type != 'log') {
|
1494
1499
|
if (result.items_) {
|
1495
1500
|
this.rollupCounts(result);
|
1496
1501
|
} else {
|
@@ -1534,8 +1539,8 @@ jasmine.PrettyPrinter.prototype.format = function(value) {
|
|
1534
1539
|
this.emitScalar('undefined');
|
1535
1540
|
} else if (value === null) {
|
1536
1541
|
this.emitScalar('null');
|
1537
|
-
} else if (value
|
1538
|
-
this.emitScalar('<
|
1542
|
+
} else if (value === jasmine.getGlobal()) {
|
1543
|
+
this.emitScalar('<global>');
|
1539
1544
|
} else if (value instanceof jasmine.Matchers.Any) {
|
1540
1545
|
this.emitScalar(value.toString());
|
1541
1546
|
} else if (typeof value === 'string') {
|
@@ -1727,49 +1732,6 @@ jasmine.Queue.prototype.results = function() {
|
|
1727
1732
|
};
|
1728
1733
|
|
1729
1734
|
|
1730
|
-
/** JasmineReporters.reporter
|
1731
|
-
* Base object that will get called whenever a Spec, Suite, or Runner is done. It is up to
|
1732
|
-
* descendants of this object to do something with the results (see json_reporter.js)
|
1733
|
-
*
|
1734
|
-
* @deprecated
|
1735
|
-
*/
|
1736
|
-
jasmine.Reporters = {};
|
1737
|
-
|
1738
|
-
/**
|
1739
|
-
* @deprecated
|
1740
|
-
* @param callbacks
|
1741
|
-
*/
|
1742
|
-
jasmine.Reporters.reporter = function(callbacks) {
|
1743
|
-
/**
|
1744
|
-
* @deprecated
|
1745
|
-
* @param callbacks
|
1746
|
-
*/
|
1747
|
-
var that = {
|
1748
|
-
callbacks: callbacks || {},
|
1749
|
-
|
1750
|
-
doCallback: function(callback, results) {
|
1751
|
-
if (callback) {
|
1752
|
-
callback(results);
|
1753
|
-
}
|
1754
|
-
},
|
1755
|
-
|
1756
|
-
reportRunnerResults: function(runner) {
|
1757
|
-
that.doCallback(that.callbacks.runnerCallback, runner);
|
1758
|
-
},
|
1759
|
-
reportSuiteResults: function(suite) {
|
1760
|
-
that.doCallback(that.callbacks.suiteCallback, suite);
|
1761
|
-
},
|
1762
|
-
reportSpecResults: function(spec) {
|
1763
|
-
that.doCallback(that.callbacks.specCallback, spec);
|
1764
|
-
},
|
1765
|
-
log: function (str) {
|
1766
|
-
if (console && console.log) console.log(str);
|
1767
|
-
}
|
1768
|
-
};
|
1769
|
-
|
1770
|
-
return that;
|
1771
|
-
};
|
1772
|
-
|
1773
1735
|
/**
|
1774
1736
|
* Runner
|
1775
1737
|
*
|
@@ -1886,13 +1848,13 @@ jasmine.Spec.prototype.results = function() {
|
|
1886
1848
|
return this.results_;
|
1887
1849
|
};
|
1888
1850
|
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
jasmine.Spec.prototype.
|
1895
|
-
return this.results_;
|
1851
|
+
/**
|
1852
|
+
* All parameters are pretty-printed and concatenated together, then written to the spec's output.
|
1853
|
+
*
|
1854
|
+
* Be careful not to leave calls to <code>jasmine.log</code> in production code.
|
1855
|
+
*/
|
1856
|
+
jasmine.Spec.prototype.log = function() {
|
1857
|
+
return this.results_.log(arguments);
|
1896
1858
|
};
|
1897
1859
|
|
1898
1860
|
jasmine.Spec.prototype.runs = function (func) {
|
@@ -1909,6 +1871,9 @@ jasmine.Spec.prototype.addToQueue = function (block) {
|
|
1909
1871
|
}
|
1910
1872
|
};
|
1911
1873
|
|
1874
|
+
/**
|
1875
|
+
* @param {jasmine.ExpectationResult} result
|
1876
|
+
*/
|
1912
1877
|
jasmine.Spec.prototype.addMatcherResult = function(result) {
|
1913
1878
|
this.results_.addResult(result);
|
1914
1879
|
};
|
@@ -1980,7 +1945,8 @@ jasmine.Spec.prototype.execute = function(onComplete) {
|
|
1980
1945
|
spec.finish(onComplete);
|
1981
1946
|
return;
|
1982
1947
|
}
|
1983
|
-
|
1948
|
+
|
1949
|
+
this.env.reporter.reportSpecStarting(this);
|
1984
1950
|
|
1985
1951
|
spec.env.currentSpec = spec;
|
1986
1952
|
|
@@ -2106,15 +2072,15 @@ jasmine.Suite.prototype.results = function() {
|
|
2106
2072
|
return this.queue.results();
|
2107
2073
|
};
|
2108
2074
|
|
2109
|
-
jasmine.Suite.prototype.add = function(
|
2110
|
-
this.children_.push(
|
2111
|
-
if (
|
2112
|
-
this.suites_.push(
|
2113
|
-
this.env.currentRunner().addSuite(
|
2075
|
+
jasmine.Suite.prototype.add = function(suiteOrSpec) {
|
2076
|
+
this.children_.push(suiteOrSpec);
|
2077
|
+
if (suiteOrSpec instanceof jasmine.Suite) {
|
2078
|
+
this.suites_.push(suiteOrSpec);
|
2079
|
+
this.env.currentRunner().addSuite(suiteOrSpec);
|
2114
2080
|
} else {
|
2115
|
-
this.specs_.push(
|
2081
|
+
this.specs_.push(suiteOrSpec);
|
2116
2082
|
}
|
2117
|
-
this.queue.add(
|
2083
|
+
this.queue.add(suiteOrSpec);
|
2118
2084
|
};
|
2119
2085
|
|
2120
2086
|
jasmine.Suite.prototype.specs = function() {
|
@@ -2251,9 +2217,9 @@ jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMil
|
|
2251
2217
|
funcToRun.funcToCall();
|
2252
2218
|
if (funcToRun.recurring) {
|
2253
2219
|
this.scheduleFunction(funcToRun.timeoutKey,
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2220
|
+
funcToRun.funcToCall,
|
2221
|
+
funcToRun.millis,
|
2222
|
+
true);
|
2257
2223
|
}
|
2258
2224
|
} catch(e) {
|
2259
2225
|
}
|
@@ -2297,10 +2263,12 @@ jasmine.Clock = {
|
|
2297
2263
|
},
|
2298
2264
|
|
2299
2265
|
useMock: function() {
|
2300
|
-
|
2301
|
-
|
2266
|
+
if (!jasmine.Clock.isInstalled()) {
|
2267
|
+
var spec = jasmine.getEnv().currentSpec;
|
2268
|
+
spec.after(jasmine.Clock.uninstallMock);
|
2302
2269
|
|
2303
|
-
|
2270
|
+
jasmine.Clock.installMock();
|
2271
|
+
}
|
2304
2272
|
},
|
2305
2273
|
|
2306
2274
|
installMock: function() {
|
@@ -2313,24 +2281,28 @@ jasmine.Clock = {
|
|
2313
2281
|
},
|
2314
2282
|
|
2315
2283
|
real: {
|
2316
|
-
setTimeout:
|
2317
|
-
clearTimeout:
|
2318
|
-
setInterval:
|
2319
|
-
clearInterval:
|
2284
|
+
setTimeout: jasmine.getGlobal().setTimeout,
|
2285
|
+
clearTimeout: jasmine.getGlobal().clearTimeout,
|
2286
|
+
setInterval: jasmine.getGlobal().setInterval,
|
2287
|
+
clearInterval: jasmine.getGlobal().clearInterval
|
2320
2288
|
},
|
2321
2289
|
|
2322
2290
|
assertInstalled: function() {
|
2323
|
-
if (jasmine.Clock.
|
2291
|
+
if (!jasmine.Clock.isInstalled()) {
|
2324
2292
|
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
|
2325
2293
|
}
|
2326
2294
|
},
|
2327
2295
|
|
2296
|
+
isInstalled: function() {
|
2297
|
+
return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
|
2298
|
+
},
|
2299
|
+
|
2328
2300
|
installed: null
|
2329
2301
|
};
|
2330
2302
|
jasmine.Clock.installed = jasmine.Clock.real;
|
2331
2303
|
|
2332
2304
|
//else for IE support
|
2333
|
-
|
2305
|
+
jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
|
2334
2306
|
if (jasmine.Clock.installed.setTimeout.apply) {
|
2335
2307
|
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
|
2336
2308
|
} else {
|
@@ -2338,7 +2310,7 @@ window.setTimeout = function(funcToCall, millis) {
|
|
2338
2310
|
}
|
2339
2311
|
};
|
2340
2312
|
|
2341
|
-
|
2313
|
+
jasmine.getGlobal().setInterval = function(funcToCall, millis) {
|
2342
2314
|
if (jasmine.Clock.installed.setInterval.apply) {
|
2343
2315
|
return jasmine.Clock.installed.setInterval.apply(this, arguments);
|
2344
2316
|
} else {
|
@@ -2346,7 +2318,7 @@ window.setInterval = function(funcToCall, millis) {
|
|
2346
2318
|
}
|
2347
2319
|
};
|
2348
2320
|
|
2349
|
-
|
2321
|
+
jasmine.getGlobal().clearTimeout = function(timeoutKey) {
|
2350
2322
|
if (jasmine.Clock.installed.clearTimeout.apply) {
|
2351
2323
|
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
|
2352
2324
|
} else {
|
@@ -2354,18 +2326,18 @@ window.clearTimeout = function(timeoutKey) {
|
|
2354
2326
|
}
|
2355
2327
|
};
|
2356
2328
|
|
2357
|
-
|
2329
|
+
jasmine.getGlobal().clearInterval = function(timeoutKey) {
|
2358
2330
|
if (jasmine.Clock.installed.clearTimeout.apply) {
|
2359
2331
|
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
|
2360
2332
|
} else {
|
2361
|
-
|
2333
|
+
return jasmine.Clock.installed.clearInterval(timeoutKey);
|
2362
2334
|
}
|
2363
2335
|
};
|
2364
2336
|
|
2365
2337
|
|
2366
2338
|
jasmine.version_= {
|
2367
2339
|
"major": 0,
|
2368
|
-
"minor":
|
2369
|
-
"build":
|
2370
|
-
"revision":
|
2371
|
-
|
2340
|
+
"minor": 11,
|
2341
|
+
"build": 1,
|
2342
|
+
"revision": 1277514571
|
2343
|
+
};
|