jasmine 0.10.4.0 → 0.11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +2 -2
- data/jasmine/lib/TrivialReporter.js +11 -8
- data/jasmine/lib/{jasmine-0.10.4.js → jasmine.js} +116 -148
- data/lib/jasmine/spec_builder.rb +1 -1
- metadata +41 -22
data/README.markdown
CHANGED
@@ -28,8 +28,6 @@ jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarA
|
|
28
28
|
};
|
29
29
|
|
30
30
|
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
31
|
-
var suites = runner.suites();
|
32
|
-
|
33
31
|
var showPassed, showSkipped;
|
34
32
|
|
35
33
|
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
|
@@ -54,15 +52,16 @@ jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
|
54
52
|
|
55
53
|
this.document.body.appendChild(this.outerDiv);
|
56
54
|
|
55
|
+
var suites = runner.suites();
|
57
56
|
for (var i = 0; i < suites.length; i++) {
|
58
57
|
var suite = suites[i];
|
59
58
|
var suiteDiv = this.createDom('div', { className: 'suite' },
|
60
59
|
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
61
60
|
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
|
62
|
-
this.suiteDivs[suite.
|
61
|
+
this.suiteDivs[suite.id] = suiteDiv;
|
63
62
|
var parentDiv = this.outerDiv;
|
64
63
|
if (suite.parentSuite) {
|
65
|
-
parentDiv = this.suiteDivs[suite.parentSuite.
|
64
|
+
parentDiv = this.suiteDivs[suite.parentSuite.id];
|
66
65
|
}
|
67
66
|
parentDiv.appendChild(suiteDiv);
|
68
67
|
}
|
@@ -113,7 +112,7 @@ jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
|
|
113
112
|
if (results.totalCount == 0) { // todo: change this to check results.skipped
|
114
113
|
status = 'skipped';
|
115
114
|
}
|
116
|
-
this.suiteDivs[suite.
|
115
|
+
this.suiteDivs[suite.id].className += " " + status;
|
117
116
|
};
|
118
117
|
|
119
118
|
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
@@ -135,7 +134,10 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
|
135
134
|
var messagesDiv = this.createDom('div', { className: 'messages' });
|
136
135
|
for (var i = 0; i < resultItems.length; i++) {
|
137
136
|
var result = resultItems[i];
|
138
|
-
|
137
|
+
|
138
|
+
if (result.type == 'log') {
|
139
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
140
|
+
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
139
141
|
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
140
142
|
|
141
143
|
if (result.trace.stack) {
|
@@ -148,11 +150,12 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
|
148
150
|
specDiv.appendChild(messagesDiv);
|
149
151
|
}
|
150
152
|
|
151
|
-
this.suiteDivs[spec.suite.
|
153
|
+
this.suiteDivs[spec.suite.id].appendChild(specDiv);
|
152
154
|
};
|
153
155
|
|
154
156
|
jasmine.TrivialReporter.prototype.log = function() {
|
155
|
-
console.
|
157
|
+
var console = jasmine.getGlobal().console;
|
158
|
+
if (console && console.log) console.log.apply(console, arguments);
|
156
159
|
};
|
157
160
|
|
158
161
|
jasmine.TrivialReporter.prototype.getLocation = function() {
|
@@ -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
|
};
|
@@ -395,8 +409,14 @@ jasmine.createSpyObj = function(baseName, methodNames) {
|
|
395
409
|
return obj;
|
396
410
|
};
|
397
411
|
|
398
|
-
|
399
|
-
|
412
|
+
/**
|
413
|
+
* All parameters are pretty-printed and concatenated together, then written to the current spec's output.
|
414
|
+
*
|
415
|
+
* Be careful not to leave calls to <code>jasmine.log</code> in production code.
|
416
|
+
*/
|
417
|
+
jasmine.log = function() {
|
418
|
+
var spec = jasmine.getEnv().currentSpec;
|
419
|
+
spec.log.apply(spec, arguments);
|
400
420
|
};
|
401
421
|
|
402
422
|
/**
|
@@ -559,31 +579,6 @@ jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
|
|
559
579
|
}
|
560
580
|
throw new Error("This browser does not support XMLHttpRequest.");
|
561
581
|
} : 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
582
|
/**
|
588
583
|
* @namespace
|
589
584
|
*/
|
@@ -976,7 +971,7 @@ jasmine.JsApiReporter = function() {
|
|
976
971
|
|
977
972
|
jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
|
978
973
|
this.started = true;
|
979
|
-
var suites = runner.
|
974
|
+
var suites = runner.topLevelSuites();
|
980
975
|
for (var i = 0; i < suites.length; i++) {
|
981
976
|
var suite = suites[i];
|
982
977
|
this.suites_.push(this.summarize_(suite));
|
@@ -995,10 +990,11 @@ jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
|
|
995
990
|
type: isSuite ? 'suite' : 'spec',
|
996
991
|
children: []
|
997
992
|
};
|
993
|
+
|
998
994
|
if (isSuite) {
|
999
|
-
var
|
1000
|
-
for (var i = 0; i <
|
1001
|
-
summary.children.push(this.summarize_(
|
995
|
+
var children = suiteOrSpec.children();
|
996
|
+
for (var i = 0; i < children.length; i++) {
|
997
|
+
summary.children.push(this.summarize_(children[i]));
|
1002
998
|
}
|
1003
999
|
}
|
1004
1000
|
return summary;
|
@@ -1044,11 +1040,11 @@ jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
|
|
1044
1040
|
|
1045
1041
|
jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
|
1046
1042
|
var summaryMessages = [];
|
1047
|
-
var messagesLength = result.messages.length
|
1043
|
+
var messagesLength = result.messages.length;
|
1048
1044
|
for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
|
1049
1045
|
var resultMessage = result.messages[messageIndex];
|
1050
1046
|
summaryMessages.push({
|
1051
|
-
text: resultMessage.
|
1047
|
+
text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
|
1052
1048
|
passed: resultMessage.passed ? resultMessage.passed() : true,
|
1053
1049
|
type: resultMessage.type,
|
1054
1050
|
message: resultMessage.message,
|
@@ -1056,14 +1052,12 @@ jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
|
|
1056
1052
|
stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
|
1057
1053
|
}
|
1058
1054
|
});
|
1059
|
-
}
|
1055
|
+
}
|
1060
1056
|
|
1061
|
-
|
1057
|
+
return {
|
1062
1058
|
result : result.result,
|
1063
1059
|
messages : summaryMessages
|
1064
1060
|
};
|
1065
|
-
|
1066
|
-
return summaryResult;
|
1067
1061
|
};
|
1068
1062
|
|
1069
1063
|
/**
|
@@ -1083,25 +1077,11 @@ jasmine.Matchers = function(env, actual, spec, opt_isNot) {
|
|
1083
1077
|
// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
|
1084
1078
|
jasmine.Matchers.pp = function(str) {
|
1085
1079
|
throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
|
1086
|
-
this.report();
|
1087
1080
|
};
|
1088
1081
|
|
1089
|
-
|
1082
|
+
// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
|
1090
1083
|
jasmine.Matchers.prototype.report = function(result, failing_message, details) {
|
1091
|
-
|
1092
|
-
|
1093
|
-
if (this.isNot) {
|
1094
|
-
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
|
1095
|
-
}
|
1096
|
-
|
1097
|
-
this.reportWasCalled_ = true;
|
1098
|
-
var expectationResult = new jasmine.ExpectationResult({
|
1099
|
-
passed: result,
|
1100
|
-
message: failing_message,
|
1101
|
-
details: details
|
1102
|
-
});
|
1103
|
-
this.spec.addMatcherResult(expectationResult);
|
1104
|
-
return result;
|
1084
|
+
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
|
1105
1085
|
};
|
1106
1086
|
|
1107
1087
|
jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
|
@@ -1470,11 +1450,11 @@ jasmine.NestedResults.prototype.rollupCounts = function(result) {
|
|
1470
1450
|
};
|
1471
1451
|
|
1472
1452
|
/**
|
1473
|
-
*
|
1474
|
-
* @param message
|
1453
|
+
* Adds a log message.
|
1454
|
+
* @param values Array of message parts which will be concatenated later.
|
1475
1455
|
*/
|
1476
|
-
jasmine.NestedResults.prototype.log = function(
|
1477
|
-
this.items_.push(new jasmine.MessageResult(
|
1456
|
+
jasmine.NestedResults.prototype.log = function(values) {
|
1457
|
+
this.items_.push(new jasmine.MessageResult(values));
|
1478
1458
|
};
|
1479
1459
|
|
1480
1460
|
/**
|
@@ -1489,7 +1469,7 @@ jasmine.NestedResults.prototype.getItems = function() {
|
|
1489
1469
|
* @param {jasmine.ExpectationResult|jasmine.NestedResults} result
|
1490
1470
|
*/
|
1491
1471
|
jasmine.NestedResults.prototype.addResult = function(result) {
|
1492
|
-
if (result.type != '
|
1472
|
+
if (result.type != 'log') {
|
1493
1473
|
if (result.items_) {
|
1494
1474
|
this.rollupCounts(result);
|
1495
1475
|
} else {
|
@@ -1533,8 +1513,8 @@ jasmine.PrettyPrinter.prototype.format = function(value) {
|
|
1533
1513
|
this.emitScalar('undefined');
|
1534
1514
|
} else if (value === null) {
|
1535
1515
|
this.emitScalar('null');
|
1536
|
-
} else if (value
|
1537
|
-
this.emitScalar('<
|
1516
|
+
} else if (value === jasmine.getGlobal()) {
|
1517
|
+
this.emitScalar('<global>');
|
1538
1518
|
} else if (value instanceof jasmine.Matchers.Any) {
|
1539
1519
|
this.emitScalar(value.toString());
|
1540
1520
|
} else if (typeof value === 'string') {
|
@@ -1726,49 +1706,6 @@ jasmine.Queue.prototype.results = function() {
|
|
1726
1706
|
};
|
1727
1707
|
|
1728
1708
|
|
1729
|
-
/** JasmineReporters.reporter
|
1730
|
-
* Base object that will get called whenever a Spec, Suite, or Runner is done. It is up to
|
1731
|
-
* descendants of this object to do something with the results (see json_reporter.js)
|
1732
|
-
*
|
1733
|
-
* @deprecated
|
1734
|
-
*/
|
1735
|
-
jasmine.Reporters = {};
|
1736
|
-
|
1737
|
-
/**
|
1738
|
-
* @deprecated
|
1739
|
-
* @param callbacks
|
1740
|
-
*/
|
1741
|
-
jasmine.Reporters.reporter = function(callbacks) {
|
1742
|
-
/**
|
1743
|
-
* @deprecated
|
1744
|
-
* @param callbacks
|
1745
|
-
*/
|
1746
|
-
var that = {
|
1747
|
-
callbacks: callbacks || {},
|
1748
|
-
|
1749
|
-
doCallback: function(callback, results) {
|
1750
|
-
if (callback) {
|
1751
|
-
callback(results);
|
1752
|
-
}
|
1753
|
-
},
|
1754
|
-
|
1755
|
-
reportRunnerResults: function(runner) {
|
1756
|
-
that.doCallback(that.callbacks.runnerCallback, runner);
|
1757
|
-
},
|
1758
|
-
reportSuiteResults: function(suite) {
|
1759
|
-
that.doCallback(that.callbacks.suiteCallback, suite);
|
1760
|
-
},
|
1761
|
-
reportSpecResults: function(spec) {
|
1762
|
-
that.doCallback(that.callbacks.specCallback, spec);
|
1763
|
-
},
|
1764
|
-
log: function (str) {
|
1765
|
-
if (console && console.log) console.log(str);
|
1766
|
-
}
|
1767
|
-
};
|
1768
|
-
|
1769
|
-
return that;
|
1770
|
-
};
|
1771
|
-
|
1772
1709
|
/**
|
1773
1710
|
* Runner
|
1774
1711
|
*
|
@@ -1829,11 +1766,20 @@ jasmine.Runner.prototype.specs = function () {
|
|
1829
1766
|
return specs;
|
1830
1767
|
};
|
1831
1768
|
|
1832
|
-
|
1833
1769
|
jasmine.Runner.prototype.suites = function() {
|
1834
1770
|
return this.suites_;
|
1835
1771
|
};
|
1836
1772
|
|
1773
|
+
jasmine.Runner.prototype.topLevelSuites = function() {
|
1774
|
+
var topLevelSuites = [];
|
1775
|
+
for (var i = 0; i < this.suites_.length; i++) {
|
1776
|
+
if (!this.suites_[i].parentSuite) {
|
1777
|
+
topLevelSuites.push(this.suites_[i]);
|
1778
|
+
}
|
1779
|
+
}
|
1780
|
+
return topLevelSuites;
|
1781
|
+
};
|
1782
|
+
|
1837
1783
|
jasmine.Runner.prototype.results = function() {
|
1838
1784
|
return this.queue.results();
|
1839
1785
|
};
|
@@ -1876,13 +1822,13 @@ jasmine.Spec.prototype.results = function() {
|
|
1876
1822
|
return this.results_;
|
1877
1823
|
};
|
1878
1824
|
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
jasmine.Spec.prototype.
|
1885
|
-
return this.results_;
|
1825
|
+
/**
|
1826
|
+
* All parameters are pretty-printed and concatenated together, then written to the spec's output.
|
1827
|
+
*
|
1828
|
+
* Be careful not to leave calls to <code>jasmine.log</code> in production code.
|
1829
|
+
*/
|
1830
|
+
jasmine.Spec.prototype.log = function() {
|
1831
|
+
return this.results_.log(arguments);
|
1886
1832
|
};
|
1887
1833
|
|
1888
1834
|
jasmine.Spec.prototype.runs = function (func) {
|
@@ -1899,6 +1845,9 @@ jasmine.Spec.prototype.addToQueue = function (block) {
|
|
1899
1845
|
}
|
1900
1846
|
};
|
1901
1847
|
|
1848
|
+
/**
|
1849
|
+
* @param {jasmine.ExpectationResult} result
|
1850
|
+
*/
|
1902
1851
|
jasmine.Spec.prototype.addMatcherResult = function(result) {
|
1903
1852
|
this.results_.addResult(result);
|
1904
1853
|
};
|
@@ -2061,6 +2010,8 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
|
|
2061
2010
|
self.env = env;
|
2062
2011
|
self.before_ = [];
|
2063
2012
|
self.after_ = [];
|
2013
|
+
self.children_ = [];
|
2014
|
+
self.suites_ = [];
|
2064
2015
|
self.specs_ = [];
|
2065
2016
|
};
|
2066
2017
|
|
@@ -2094,19 +2045,29 @@ jasmine.Suite.prototype.results = function() {
|
|
2094
2045
|
return this.queue.results();
|
2095
2046
|
};
|
2096
2047
|
|
2097
|
-
jasmine.Suite.prototype.add = function(
|
2098
|
-
|
2099
|
-
|
2048
|
+
jasmine.Suite.prototype.add = function(suiteOrSpec) {
|
2049
|
+
this.children_.push(suiteOrSpec);
|
2050
|
+
if (suiteOrSpec instanceof jasmine.Suite) {
|
2051
|
+
this.suites_.push(suiteOrSpec);
|
2052
|
+
this.env.currentRunner().addSuite(suiteOrSpec);
|
2100
2053
|
} else {
|
2101
|
-
this.specs_.push(
|
2054
|
+
this.specs_.push(suiteOrSpec);
|
2102
2055
|
}
|
2103
|
-
this.queue.add(
|
2056
|
+
this.queue.add(suiteOrSpec);
|
2104
2057
|
};
|
2105
2058
|
|
2106
2059
|
jasmine.Suite.prototype.specs = function() {
|
2107
2060
|
return this.specs_;
|
2108
2061
|
};
|
2109
2062
|
|
2063
|
+
jasmine.Suite.prototype.suites = function() {
|
2064
|
+
return this.suites_;
|
2065
|
+
};
|
2066
|
+
|
2067
|
+
jasmine.Suite.prototype.children = function() {
|
2068
|
+
return this.children_;
|
2069
|
+
};
|
2070
|
+
|
2110
2071
|
jasmine.Suite.prototype.execute = function(onComplete) {
|
2111
2072
|
var self = this;
|
2112
2073
|
this.queue.start(function () {
|
@@ -2229,9 +2190,9 @@ jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMil
|
|
2229
2190
|
funcToRun.funcToCall();
|
2230
2191
|
if (funcToRun.recurring) {
|
2231
2192
|
this.scheduleFunction(funcToRun.timeoutKey,
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2193
|
+
funcToRun.funcToCall,
|
2194
|
+
funcToRun.millis,
|
2195
|
+
true);
|
2235
2196
|
}
|
2236
2197
|
} catch(e) {
|
2237
2198
|
}
|
@@ -2275,10 +2236,12 @@ jasmine.Clock = {
|
|
2275
2236
|
},
|
2276
2237
|
|
2277
2238
|
useMock: function() {
|
2278
|
-
|
2279
|
-
|
2239
|
+
if (!jasmine.Clock.isInstalled()) {
|
2240
|
+
var spec = jasmine.getEnv().currentSpec;
|
2241
|
+
spec.after(jasmine.Clock.uninstallMock);
|
2280
2242
|
|
2281
|
-
|
2243
|
+
jasmine.Clock.installMock();
|
2244
|
+
}
|
2282
2245
|
},
|
2283
2246
|
|
2284
2247
|
installMock: function() {
|
@@ -2286,29 +2249,34 @@ jasmine.Clock = {
|
|
2286
2249
|
},
|
2287
2250
|
|
2288
2251
|
uninstallMock: function() {
|
2252
|
+
jasmine.log("uninstall")
|
2289
2253
|
jasmine.Clock.assertInstalled();
|
2290
2254
|
jasmine.Clock.installed = jasmine.Clock.real;
|
2291
2255
|
},
|
2292
2256
|
|
2293
2257
|
real: {
|
2294
|
-
setTimeout:
|
2295
|
-
clearTimeout:
|
2296
|
-
setInterval:
|
2297
|
-
clearInterval:
|
2258
|
+
setTimeout: jasmine.getGlobal().setTimeout,
|
2259
|
+
clearTimeout: jasmine.getGlobal().clearTimeout,
|
2260
|
+
setInterval: jasmine.getGlobal().setInterval,
|
2261
|
+
clearInterval: jasmine.getGlobal().clearInterval
|
2298
2262
|
},
|
2299
2263
|
|
2300
2264
|
assertInstalled: function() {
|
2301
|
-
if (jasmine.Clock.
|
2265
|
+
if (!jasmine.Clock.isInstalled()) {
|
2302
2266
|
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
|
2303
2267
|
}
|
2304
2268
|
},
|
2305
2269
|
|
2270
|
+
isInstalled: function() {
|
2271
|
+
return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
|
2272
|
+
},
|
2273
|
+
|
2306
2274
|
installed: null
|
2307
2275
|
};
|
2308
2276
|
jasmine.Clock.installed = jasmine.Clock.real;
|
2309
2277
|
|
2310
2278
|
//else for IE support
|
2311
|
-
|
2279
|
+
jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
|
2312
2280
|
if (jasmine.Clock.installed.setTimeout.apply) {
|
2313
2281
|
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
|
2314
2282
|
} else {
|
@@ -2316,7 +2284,7 @@ window.setTimeout = function(funcToCall, millis) {
|
|
2316
2284
|
}
|
2317
2285
|
};
|
2318
2286
|
|
2319
|
-
|
2287
|
+
jasmine.getGlobal().setInterval = function(funcToCall, millis) {
|
2320
2288
|
if (jasmine.Clock.installed.setInterval.apply) {
|
2321
2289
|
return jasmine.Clock.installed.setInterval.apply(this, arguments);
|
2322
2290
|
} else {
|
@@ -2324,7 +2292,7 @@ window.setInterval = function(funcToCall, millis) {
|
|
2324
2292
|
}
|
2325
2293
|
};
|
2326
2294
|
|
2327
|
-
|
2295
|
+
jasmine.getGlobal().clearTimeout = function(timeoutKey) {
|
2328
2296
|
if (jasmine.Clock.installed.clearTimeout.apply) {
|
2329
2297
|
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
|
2330
2298
|
} else {
|
@@ -2332,18 +2300,18 @@ window.clearTimeout = function(timeoutKey) {
|
|
2332
2300
|
}
|
2333
2301
|
};
|
2334
2302
|
|
2335
|
-
|
2303
|
+
jasmine.getGlobal().clearInterval = function(timeoutKey) {
|
2336
2304
|
if (jasmine.Clock.installed.clearTimeout.apply) {
|
2337
2305
|
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
|
2338
2306
|
} else {
|
2339
|
-
|
2307
|
+
return jasmine.Clock.installed.clearInterval(timeoutKey);
|
2340
2308
|
}
|
2341
2309
|
};
|
2342
2310
|
|
2343
2311
|
|
2344
2312
|
jasmine.version_= {
|
2345
2313
|
"major": 0,
|
2346
|
-
"minor":
|
2347
|
-
"build":
|
2348
|
-
"revision":
|
2314
|
+
"minor": 11,
|
2315
|
+
"build": 0,
|
2316
|
+
"revision": 1277317833
|
2349
2317
|
};
|
data/lib/jasmine/spec_builder.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
- 4
|
8
|
+
- 11
|
9
9
|
- 0
|
10
|
-
|
10
|
+
- 0
|
11
|
+
version: 0.11.0.0
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Rajan Agaskar
|
@@ -16,65 +17,73 @@ autorequire:
|
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date: 2010-06-
|
20
|
+
date: 2010-06-23 00:00:00 -07:00
|
20
21
|
default_executable: jasmine
|
21
22
|
dependencies:
|
22
23
|
- !ruby/object:Gem::Dependency
|
23
|
-
|
24
|
-
|
25
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 25
|
29
30
|
segments:
|
30
31
|
- 1
|
31
32
|
- 1
|
32
33
|
- 5
|
33
34
|
version: 1.1.5
|
35
|
+
type: :runtime
|
36
|
+
name: rspec
|
37
|
+
version_requirements: *id001
|
34
38
|
prerelease: false
|
35
|
-
requirement: *id001
|
36
39
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
40
42
|
requirements:
|
41
43
|
- - ">="
|
42
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
43
46
|
segments:
|
44
47
|
- 1
|
45
48
|
- 0
|
46
49
|
- 0
|
47
50
|
version: 1.0.0
|
51
|
+
type: :runtime
|
52
|
+
name: rack
|
53
|
+
version_requirements: *id002
|
48
54
|
prerelease: false
|
49
|
-
requirement: *id002
|
50
55
|
- !ruby/object:Gem::Dependency
|
51
|
-
|
52
|
-
|
53
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
54
58
|
requirements:
|
55
59
|
- - ">="
|
56
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 11
|
57
62
|
segments:
|
58
63
|
- 2
|
59
64
|
- 1
|
60
65
|
- 0
|
61
66
|
version: 2.1.0
|
67
|
+
type: :runtime
|
68
|
+
name: selenium-rc
|
69
|
+
version_requirements: *id003
|
62
70
|
prerelease: false
|
63
|
-
requirement: *id003
|
64
71
|
- !ruby/object:Gem::Dependency
|
65
|
-
|
66
|
-
|
67
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
68
74
|
requirements:
|
69
75
|
- - ">="
|
70
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 61
|
71
78
|
segments:
|
72
79
|
- 1
|
73
80
|
- 2
|
74
81
|
- 17
|
75
82
|
version: 1.2.17
|
83
|
+
type: :runtime
|
84
|
+
name: selenium-client
|
85
|
+
version_requirements: *id004
|
76
86
|
prerelease: false
|
77
|
-
requirement: *id004
|
78
87
|
description: Javascript BDD test framework
|
79
88
|
email: ragaskar@gmail.com
|
80
89
|
executables:
|
@@ -94,8 +103,8 @@ files:
|
|
94
103
|
- generators/jasmine/templates/spec/javascripts/support/jasmine_runner.rb
|
95
104
|
- jasmine/lib/TrivialReporter.js
|
96
105
|
- jasmine/lib/consolex.js
|
97
|
-
- jasmine/lib/jasmine-0.10.4.js
|
98
106
|
- jasmine/lib/jasmine.css
|
107
|
+
- jasmine/lib/jasmine.js
|
99
108
|
- jasmine/lib/json2.js
|
100
109
|
- lib/jasmine.rb
|
101
110
|
- lib/jasmine/base.rb
|
@@ -105,6 +114,12 @@ files:
|
|
105
114
|
- lib/jasmine/server.rb
|
106
115
|
- lib/jasmine/spec_builder.rb
|
107
116
|
- README.markdown
|
117
|
+
- spec/config_spec.rb
|
118
|
+
- spec/jasmine_self_test_config.rb
|
119
|
+
- spec/jasmine_self_test_spec.rb
|
120
|
+
- spec/server_spec.rb
|
121
|
+
- spec/spec_helper.rb
|
122
|
+
- bin/jasmine
|
108
123
|
has_rdoc: true
|
109
124
|
homepage: http://github.com/pivotal/jasmine-ruby
|
110
125
|
licenses: []
|
@@ -115,23 +130,27 @@ rdoc_options:
|
|
115
130
|
require_paths:
|
116
131
|
- lib
|
117
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
118
134
|
requirements:
|
119
135
|
- - ">="
|
120
136
|
- !ruby/object:Gem::Version
|
137
|
+
hash: 3
|
121
138
|
segments:
|
122
139
|
- 0
|
123
140
|
version: "0"
|
124
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
125
143
|
requirements:
|
126
144
|
- - ">="
|
127
145
|
- !ruby/object:Gem::Version
|
146
|
+
hash: 3
|
128
147
|
segments:
|
129
148
|
- 0
|
130
149
|
version: "0"
|
131
150
|
requirements: []
|
132
151
|
|
133
152
|
rubyforge_project:
|
134
|
-
rubygems_version: 1.3.
|
153
|
+
rubygems_version: 1.3.7
|
135
154
|
signing_key:
|
136
155
|
specification_version: 3
|
137
156
|
summary: Jasmine Ruby Runner
|