teaspoon 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT.LICENSE +1 -1
- data/README.md +46 -377
- data/app/assets/javascripts/teaspoon-jasmine.js +200 -194
- data/app/assets/javascripts/teaspoon-mocha.js +183 -185
- data/app/assets/javascripts/teaspoon-qunit.js +201 -193
- data/app/assets/javascripts/teaspoon-teaspoon.js +10 -10
- data/app/assets/javascripts/teaspoon/base/fixture.coffee +0 -1
- data/app/assets/javascripts/teaspoon/base/hook.coffee +7 -6
- data/app/assets/javascripts/teaspoon/qunit.coffee +10 -0
- data/app/controllers/teaspoon/suite_controller.rb +3 -4
- data/app/views/teaspoon/suite/_boot.html.erb +1 -1
- data/app/views/teaspoon/suite/_boot_require_js.html.erb +1 -0
- data/bin/teaspoon +1 -1
- data/config/routes.rb +4 -14
- data/lib/generators/teaspoon/install/install_generator.rb +22 -11
- data/lib/generators/teaspoon/install/templates/jasmine/{env_comments.rb → env_comments.rb.tt} +10 -5
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee +5 -5
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.js +5 -5
- data/lib/generators/teaspoon/install/templates/mocha/{env_comments.rb → env_comments.rb.tt} +10 -5
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee +6 -5
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.js +6 -5
- data/lib/generators/teaspoon/install/templates/qunit/{env_comments.rb → env_comments.rb.tt} +10 -5
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.coffee +5 -5
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.js +5 -5
- data/lib/tasks/teaspoon.rake +1 -1
- data/lib/teaspoon/command_line.rb +37 -40
- data/lib/teaspoon/configuration.rb +27 -30
- data/lib/teaspoon/configuration.rb.orig +187 -0
- data/lib/teaspoon/console.rb +31 -17
- data/lib/teaspoon/coverage.rb +2 -3
- data/lib/teaspoon/deprecated.rb +13 -8
- data/lib/teaspoon/drivers/base.rb +2 -2
- data/lib/teaspoon/drivers/capybara_webkit_driver.rb +33 -0
- data/lib/teaspoon/drivers/phantomjs/runner.js +2 -2
- data/lib/teaspoon/drivers/phantomjs_driver.rb +13 -4
- data/lib/teaspoon/drivers/selenium_driver.rb +3 -5
- data/lib/teaspoon/engine.rb +33 -5
- data/lib/teaspoon/environment.rb +2 -4
- data/lib/teaspoon/exceptions.rb +8 -5
- data/lib/teaspoon/formatters/base.rb +39 -27
- data/lib/teaspoon/formatters/clean_formatter.rb +0 -1
- data/lib/teaspoon/formatters/description.rb +36 -0
- data/lib/teaspoon/formatters/documentation_formatter.rb +2 -2
- data/lib/teaspoon/formatters/json_formatter.rb +1 -2
- data/lib/teaspoon/formatters/junit_formatter.rb +20 -20
- data/lib/teaspoon/formatters/modules/report_module.rb +4 -4
- data/lib/teaspoon/formatters/pride_formatter.rb +0 -1
- data/lib/teaspoon/formatters/rspec_html_formatter.rb +463 -0
- data/lib/teaspoon/formatters/snowday_formatter.rb +0 -1
- data/lib/teaspoon/formatters/swayze_or_oprah_formatter.rb +5 -4
- data/lib/teaspoon/formatters/tap_formatter.rb +2 -3
- data/lib/teaspoon/formatters/tap_y_formatter.rb +20 -21
- data/lib/teaspoon/formatters/teamcity_formatter.rb +4 -5
- data/lib/teaspoon/instrumentation.rb +7 -7
- data/lib/teaspoon/result.rb +1 -3
- data/lib/teaspoon/runner.rb +1 -2
- data/lib/teaspoon/server.rb +2 -1
- data/lib/teaspoon/suite.rb +20 -17
- data/lib/teaspoon/utility.rb +1 -3
- data/lib/teaspoon/version.rb +1 -1
- data/spec/dummy/config/application.rb +14 -18
- data/spec/dummy/config/boot.rb +2 -6
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/development.rb +27 -13
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +26 -13
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/features/console_reporter_spec.rb +3 -8
- data/spec/features/hooks_spec.rb +17 -4
- data/spec/features/html_reporter_spec.rb +12 -1
- data/spec/features/install_generator_spec.rb +2 -3
- data/spec/features/instrumentation_spec.rb +11 -11
- data/spec/javascripts/teaspoon/base/teaspoon_spec.coffee +14 -1
- data/spec/spec_helper.rb +7 -4
- data/spec/teaspoon/command_line_spec.rb +19 -28
- data/spec/teaspoon/configuration_spec.rb +22 -14
- data/spec/teaspoon/console_spec.rb +79 -63
- data/spec/teaspoon/coverage_spec.rb +23 -23
- data/spec/teaspoon/drivers/capybara_webkit_driver_spec.rb +39 -0
- data/spec/teaspoon/drivers/phantomjs_driver_spec.rb +10 -5
- data/spec/teaspoon/drivers/selenium_driver_spec.rb +10 -10
- data/spec/teaspoon/environment_spec.rb +28 -20
- data/spec/teaspoon/exceptions_spec.rb +4 -4
- data/spec/teaspoon/exporter_spec.rb +28 -28
- data/spec/teaspoon/formatters/base_spec.rb +29 -29
- data/spec/teaspoon/formatters/clean_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/documentation_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/dot_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/json_formatter_spec.rb +7 -7
- data/spec/teaspoon/formatters/junit_formatter_spec.rb +10 -10
- data/spec/teaspoon/formatters/pride_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/rspec_html_formatter_spec.rb +107 -0
- data/spec/teaspoon/formatters/snowday_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/tap_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/tap_y_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/teamcity_formatter_spec.rb +27 -27
- data/spec/teaspoon/instrumentation_spec.rb +35 -29
- data/spec/teaspoon/result_spec.rb +40 -36
- data/spec/teaspoon/runner_spec.rb +23 -20
- data/spec/teaspoon/server_spec.rb +19 -16
- data/spec/teaspoon/suite_spec.rb +23 -9
- data/spec/teaspoon_env.rb +7 -12
- data/test/javascripts/teaspoon/qunit/models_test.coffee +6 -2
- data/vendor/assets/javascripts/support/chai-1.10.0.js +4800 -0
- data/vendor/assets/javascripts/support/chai-jq-0.0.7.js +524 -0
- data/vendor/assets/javascripts/support/chai.js +4435 -4349
- metadata +57 -54
- data/app/assets/javascripts/teaspoon-angular.js +0 -1299
- data/app/assets/javascripts/teaspoon/angular.coffee +0 -55
- data/app/assets/javascripts/teaspoon/angular/reporters/console.coffee +0 -11
- data/app/assets/javascripts/teaspoon/angular/reporters/html.coffee +0 -21
- data/spec/javascripts/angular_helper.coffee +0 -5
- data/spec/javascripts/teaspoon/angular/models_aspec.coffee +0 -95
- data/spec/javascripts/teaspoon/angular/reporters/html_aspec.coffee +0 -9
- data/vendor/assets/javascripts/angular/1.0.5.js +0 -26195
- data/vendor/assets/javascripts/angular/MIT-LICENSE +0 -22
@@ -1,6 +1,6 @@
|
|
1
1
|
(function() {
|
2
|
-
var
|
3
|
-
|
2
|
+
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
3
|
+
hasProp = {}.hasOwnProperty;
|
4
4
|
|
5
5
|
this.Teaspoon = (function() {
|
6
6
|
function Teaspoon() {}
|
@@ -51,7 +51,7 @@
|
|
51
51
|
};
|
52
52
|
|
53
53
|
Teaspoon.resolveDependenciesFromParams = function(all) {
|
54
|
-
var dep, deps, file,
|
54
|
+
var dep, deps, file, i, j, len, len1, parts, path, paths;
|
55
55
|
if (all == null) {
|
56
56
|
all = [];
|
57
57
|
}
|
@@ -59,15 +59,15 @@
|
|
59
59
|
if ((paths = Teaspoon.location.search.match(/[\?&]file(\[\])?=[^&\?]*/gi)) === null) {
|
60
60
|
return all;
|
61
61
|
}
|
62
|
-
for (
|
63
|
-
path = paths[
|
62
|
+
for (i = 0, len = paths.length; i < len; i++) {
|
63
|
+
path = paths[i];
|
64
64
|
parts = decodeURIComponent(path.replace(/\+/g, " ")).match(/\/(.+)\.(js|js.coffee|coffee)$/i);
|
65
65
|
if (parts === null) {
|
66
66
|
continue;
|
67
67
|
}
|
68
68
|
file = parts[1].substr(parts[1].lastIndexOf("/") + 1);
|
69
|
-
for (
|
70
|
-
dep = all[
|
69
|
+
for (j = 0, len1 = all.length; j < len1; j++) {
|
70
|
+
dep = all[j];
|
71
71
|
if (dep.indexOf(file) >= 0) {
|
72
72
|
deps.push(dep);
|
73
73
|
}
|
@@ -98,8 +98,8 @@
|
|
98
98
|
|
99
99
|
})();
|
100
100
|
|
101
|
-
Teaspoon.Error = (function(
|
102
|
-
|
101
|
+
Teaspoon.Error = (function(superClass) {
|
102
|
+
extend(Error, superClass);
|
103
103
|
|
104
104
|
function Error(message) {
|
105
105
|
this.name = "TeaspoonError";
|
@@ -120,18 +120,18 @@
|
|
120
120
|
return;
|
121
121
|
}
|
122
122
|
this.constructor.run = true;
|
123
|
-
this.fixturePath =
|
123
|
+
this.fixturePath = Teaspoon.root + "/fixtures";
|
124
124
|
this.params = Teaspoon.params = this.getParams();
|
125
125
|
this.setup();
|
126
126
|
}
|
127
127
|
|
128
128
|
Runner.prototype.getParams = function() {
|
129
|
-
var
|
129
|
+
var i, len, name, param, params, ref, ref1, value;
|
130
130
|
params = {};
|
131
|
-
|
132
|
-
for (
|
133
|
-
param =
|
134
|
-
|
131
|
+
ref = Teaspoon.location.search.substring(1).split("&");
|
132
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
133
|
+
param = ref[i];
|
134
|
+
ref1 = param.split("="), name = ref1[0], value = ref1[1];
|
135
135
|
params[decodeURIComponent(name)] = decodeURIComponent(value);
|
136
136
|
}
|
137
137
|
return params;
|
@@ -157,11 +157,10 @@
|
|
157
157
|
|
158
158
|
}).call(this);
|
159
159
|
(function() {
|
160
|
-
var
|
160
|
+
var slice = [].slice;
|
161
161
|
|
162
162
|
Teaspoon.fixture = (function() {
|
163
|
-
var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest
|
164
|
-
_this = this;
|
163
|
+
var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest;
|
165
164
|
|
166
165
|
fixture.cache = {};
|
167
166
|
|
@@ -172,19 +171,19 @@
|
|
172
171
|
fixture.json = [];
|
173
172
|
|
174
173
|
fixture.preload = function() {
|
175
|
-
var
|
176
|
-
urls = 1 <= arguments.length ?
|
177
|
-
|
178
|
-
for (
|
179
|
-
url = urls[
|
180
|
-
|
174
|
+
var i, len, results, url, urls;
|
175
|
+
urls = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
176
|
+
results = [];
|
177
|
+
for (i = 0, len = urls.length; i < len; i++) {
|
178
|
+
url = urls[i];
|
179
|
+
results.push(preload(url));
|
181
180
|
}
|
182
|
-
return
|
181
|
+
return results;
|
183
182
|
};
|
184
183
|
|
185
184
|
fixture.load = function() {
|
186
|
-
var append,
|
187
|
-
urls = 2 <= arguments.length ?
|
185
|
+
var append, i, index, j, len, results, url, urls;
|
186
|
+
urls = 2 <= arguments.length ? slice.call(arguments, 0, i = arguments.length - 1) : (i = 0, []), append = arguments[i++];
|
188
187
|
if (append == null) {
|
189
188
|
append = false;
|
190
189
|
}
|
@@ -192,17 +191,17 @@
|
|
192
191
|
urls.push(append);
|
193
192
|
append = false;
|
194
193
|
}
|
195
|
-
|
196
|
-
for (index =
|
194
|
+
results = [];
|
195
|
+
for (index = j = 0, len = urls.length; j < len; index = ++j) {
|
197
196
|
url = urls[index];
|
198
|
-
|
197
|
+
results.push(load(url, append || index > 0));
|
199
198
|
}
|
200
|
-
return
|
199
|
+
return results;
|
201
200
|
};
|
202
201
|
|
203
202
|
fixture.set = function() {
|
204
|
-
var append, html, htmls,
|
205
|
-
htmls = 2 <= arguments.length ?
|
203
|
+
var append, html, htmls, i, index, j, len, results;
|
204
|
+
htmls = 2 <= arguments.length ? slice.call(arguments, 0, i = arguments.length - 1) : (i = 0, []), append = arguments[i++];
|
206
205
|
if (append == null) {
|
207
206
|
append = false;
|
208
207
|
}
|
@@ -210,12 +209,12 @@
|
|
210
209
|
htmls.push(append);
|
211
210
|
append = false;
|
212
211
|
}
|
213
|
-
|
214
|
-
for (index =
|
212
|
+
results = [];
|
213
|
+
for (index = j = 0, len = htmls.length; j < len; index = ++j) {
|
215
214
|
html = htmls[index];
|
216
|
-
|
215
|
+
results.push(set(html, append || index > 0));
|
217
216
|
}
|
218
|
-
return
|
217
|
+
return results;
|
219
218
|
};
|
220
219
|
|
221
220
|
fixture.cleanup = function() {
|
@@ -294,21 +293,21 @@
|
|
294
293
|
};
|
295
294
|
|
296
295
|
create = function() {
|
297
|
-
var
|
296
|
+
var ref;
|
298
297
|
Teaspoon.fixture.el = document.createElement("div");
|
299
298
|
if (typeof window.$ === 'function') {
|
300
299
|
Teaspoon.fixture.$el = $(Teaspoon.fixture.el);
|
301
300
|
}
|
302
301
|
Teaspoon.fixture.el.id = "teaspoon-fixtures";
|
303
|
-
return (
|
302
|
+
return (ref = document.body) != null ? ref.appendChild(Teaspoon.fixture.el) : void 0;
|
304
303
|
};
|
305
304
|
|
306
305
|
cleanup = function() {
|
307
|
-
var
|
308
|
-
(
|
309
|
-
if ((
|
310
|
-
if ((
|
311
|
-
|
306
|
+
var base, ref, ref1;
|
307
|
+
(base = Teaspoon.fixture).el || (base.el = document.getElementById("teaspoon-fixtures"));
|
308
|
+
if ((ref = Teaspoon.fixture.el) != null) {
|
309
|
+
if ((ref1 = ref.parentNode) != null) {
|
310
|
+
ref1.removeChild(Teaspoon.fixture.el);
|
312
311
|
}
|
313
312
|
}
|
314
313
|
return Teaspoon.fixture.el = null;
|
@@ -334,23 +333,24 @@
|
|
334
333
|
throw "Unable to make Ajax Request";
|
335
334
|
}
|
336
335
|
xhr.onreadystatechange = callback;
|
337
|
-
xhr.open("GET",
|
336
|
+
xhr.open("GET", Teaspoon.root + "/fixtures/" + url, false);
|
338
337
|
return xhr.send();
|
339
338
|
};
|
340
339
|
|
341
340
|
return fixture;
|
342
341
|
|
343
|
-
})
|
342
|
+
})();
|
344
343
|
|
345
344
|
}).call(this);
|
346
345
|
(function() {
|
347
|
-
Teaspoon.hook = function(name,
|
348
|
-
var xhr, xhrRequest;
|
349
|
-
if (
|
350
|
-
|
346
|
+
Teaspoon.hook = function(name, payload) {
|
347
|
+
var method, xhr, xhrRequest;
|
348
|
+
if (payload == null) {
|
349
|
+
payload = {};
|
351
350
|
}
|
351
|
+
method = "POST";
|
352
352
|
xhr = null;
|
353
|
-
xhrRequest = function(url,
|
353
|
+
xhrRequest = function(url, payload, callback) {
|
354
354
|
var e;
|
355
355
|
if (window.XMLHttpRequest) {
|
356
356
|
xhr = new XMLHttpRequest();
|
@@ -370,10 +370,13 @@
|
|
370
370
|
throw "Unable to make Ajax Request";
|
371
371
|
}
|
372
372
|
xhr.onreadystatechange = callback;
|
373
|
-
xhr.open(
|
374
|
-
|
373
|
+
xhr.open("POST", Teaspoon.root + "/" + url, false);
|
374
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
375
|
+
return xhr.send(JSON.stringify({
|
376
|
+
args: payload
|
377
|
+
}));
|
375
378
|
};
|
376
|
-
return xhrRequest(
|
379
|
+
return xhrRequest(Teaspoon.suites.active + "/" + name, payload, function() {
|
377
380
|
if (xhr.readyState !== 4) {
|
378
381
|
return;
|
379
382
|
}
|
@@ -414,9 +417,9 @@
|
|
414
417
|
};
|
415
418
|
|
416
419
|
BaseView.prototype.findEl = function(id) {
|
417
|
-
var
|
420
|
+
var base;
|
418
421
|
this.elements || (this.elements = {});
|
419
|
-
return (
|
422
|
+
return (base = this.elements)[id] || (base[id] = document.getElementById("teaspoon-" + id));
|
420
423
|
};
|
421
424
|
|
422
425
|
BaseView.prototype.setText = function(id, value) {
|
@@ -457,17 +460,17 @@
|
|
457
460
|
|
458
461
|
}).call(this);
|
459
462
|
(function() {
|
460
|
-
var
|
461
|
-
|
462
|
-
|
463
|
+
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
464
|
+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
465
|
+
hasProp = {}.hasOwnProperty;
|
463
466
|
|
464
|
-
Teaspoon.Reporters.HTML = (function(
|
465
|
-
|
467
|
+
Teaspoon.Reporters.HTML = (function(superClass) {
|
468
|
+
extend(HTML, superClass);
|
466
469
|
|
467
470
|
function HTML() {
|
468
|
-
this.changeSuite =
|
469
|
-
this.toggleConfig =
|
470
|
-
this.reportRunnerResults =
|
471
|
+
this.changeSuite = bind(this.changeSuite, this);
|
472
|
+
this.toggleConfig = bind(this.toggleConfig, this);
|
473
|
+
this.reportRunnerResults = bind(this.reportRunnerResults, this);
|
471
474
|
this.start = new Teaspoon.Date().getTime();
|
472
475
|
this.config = {
|
473
476
|
"use-catch": true,
|
@@ -492,14 +495,14 @@
|
|
492
495
|
}
|
493
496
|
|
494
497
|
HTML.prototype.build = function() {
|
495
|
-
var
|
498
|
+
var ref;
|
496
499
|
this.buildLayout();
|
497
500
|
this.setText("env-info", this.envInfo());
|
498
501
|
this.setText("version", Teaspoon.version);
|
499
502
|
this.findEl("toggles").onclick = this.toggleConfig;
|
500
503
|
this.findEl("suites").innerHTML = this.buildSuiteSelect();
|
501
|
-
if ((
|
502
|
-
|
504
|
+
if ((ref = this.findEl("suite-select")) != null) {
|
505
|
+
ref.onchange = this.changeSuite;
|
503
506
|
}
|
504
507
|
this.el = this.findEl("report-all");
|
505
508
|
this.showConfiguration();
|
@@ -516,7 +519,7 @@
|
|
516
519
|
};
|
517
520
|
|
518
521
|
HTML.prototype.buildSuiteSelect = function() {
|
519
|
-
var filename,
|
522
|
+
var filename, i, len, options, path, ref, selected, suite;
|
520
523
|
if (Teaspoon.suites.all.length === 1) {
|
521
524
|
return "";
|
522
525
|
}
|
@@ -525,9 +528,9 @@
|
|
525
528
|
filename = "/index.html";
|
526
529
|
}
|
527
530
|
options = [];
|
528
|
-
|
529
|
-
for (
|
530
|
-
suite =
|
531
|
+
ref = Teaspoon.suites.all;
|
532
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
533
|
+
suite = ref[i];
|
531
534
|
path = [Teaspoon.root, suite].join("/");
|
532
535
|
selected = Teaspoon.suites.active === suite ? " selected" : "";
|
533
536
|
options.push("<option" + selected + " value=\"" + path + filename + "\">" + suite + "</option>");
|
@@ -587,7 +590,7 @@
|
|
587
590
|
};
|
588
591
|
|
589
592
|
HTML.prototype.elapsedTime = function() {
|
590
|
-
return
|
593
|
+
return (((new Teaspoon.Date().getTime() - this.start) / 1000).toFixed(3)) + "s";
|
591
594
|
};
|
592
595
|
|
593
596
|
HTML.prototype.updateStat = function(name, value) {
|
@@ -598,7 +601,7 @@
|
|
598
601
|
};
|
599
602
|
|
600
603
|
HTML.prototype.updateStatus = function(spec) {
|
601
|
-
var elapsed,
|
604
|
+
var elapsed, ref, ref1, result;
|
602
605
|
spec = new Teaspoon.Spec(spec);
|
603
606
|
result = spec.result();
|
604
607
|
if (result.skipped || result.status === "pending") {
|
@@ -608,11 +611,11 @@
|
|
608
611
|
elapsed = new Teaspoon.Date().getTime() - this.specStart;
|
609
612
|
if (result.status === "passed") {
|
610
613
|
this.updateStat("passes", this.total.passes += 1);
|
611
|
-
return (
|
614
|
+
return (ref = this.reportView) != null ? ref.updateState("passed", elapsed) : void 0;
|
612
615
|
} else {
|
613
616
|
this.updateStat("failures", this.total.failures += 1);
|
614
|
-
if ((
|
615
|
-
|
617
|
+
if ((ref1 = this.reportView) != null) {
|
618
|
+
ref1.updateState("failed", elapsed);
|
616
619
|
}
|
617
620
|
if (!this.config["build-full-report"]) {
|
618
621
|
new Teaspoon.Reporters.HTML.FailureView(spec).appendTo(this.findEl("report-failures"));
|
@@ -626,14 +629,14 @@
|
|
626
629
|
};
|
627
630
|
|
628
631
|
HTML.prototype.showConfiguration = function() {
|
629
|
-
var key,
|
630
|
-
|
631
|
-
|
632
|
-
for (key in
|
633
|
-
value =
|
634
|
-
|
632
|
+
var key, ref, results, value;
|
633
|
+
ref = this.config;
|
634
|
+
results = [];
|
635
|
+
for (key in ref) {
|
636
|
+
value = ref[key];
|
637
|
+
results.push(this.setClass(key, value ? "active" : ""));
|
635
638
|
}
|
636
|
-
return
|
639
|
+
return results;
|
637
640
|
};
|
638
641
|
|
639
642
|
HTML.prototype.setStatus = function(status) {
|
@@ -675,8 +678,8 @@
|
|
675
678
|
};
|
676
679
|
|
677
680
|
HTML.prototype.store = function(name, value) {
|
678
|
-
var
|
679
|
-
if (((
|
681
|
+
var ref;
|
682
|
+
if (((ref = window.localStorage) != null ? ref.setItem : void 0) != null) {
|
680
683
|
return this.localstore(name, value);
|
681
684
|
} else {
|
682
685
|
return this.cookie(name, value);
|
@@ -695,7 +698,7 @@
|
|
695
698
|
} else {
|
696
699
|
date = new Teaspoon.Date();
|
697
700
|
date.setDate(date.getDate() + 365);
|
698
|
-
return document.cookie =
|
701
|
+
return document.cookie = name + "=" + (escape(JSON.stringify(value))) + "; expires=" + (date.toUTCString()) + "; path=/;";
|
699
702
|
}
|
700
703
|
};
|
701
704
|
|
@@ -716,16 +719,14 @@
|
|
716
719
|
|
717
720
|
}).call(this);
|
718
721
|
(function() {
|
719
|
-
var
|
720
|
-
|
721
|
-
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
722
|
+
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
723
|
+
hasProp = {}.hasOwnProperty;
|
722
724
|
|
723
|
-
Teaspoon.Reporters.HTML.ProgressView = (function(
|
724
|
-
|
725
|
+
Teaspoon.Reporters.HTML.ProgressView = (function(superClass) {
|
726
|
+
extend(ProgressView, superClass);
|
725
727
|
|
726
728
|
function ProgressView() {
|
727
|
-
|
728
|
-
return _ref;
|
729
|
+
return ProgressView.__super__.constructor.apply(this, arguments);
|
729
730
|
}
|
730
731
|
|
731
732
|
ProgressView.create = function(displayProgress) {
|
@@ -752,12 +753,11 @@
|
|
752
753
|
|
753
754
|
})(Teaspoon.Reporters.BaseView);
|
754
755
|
|
755
|
-
Teaspoon.Reporters.HTML.SimpleProgressView = (function(
|
756
|
-
|
756
|
+
Teaspoon.Reporters.HTML.SimpleProgressView = (function(superClass) {
|
757
|
+
extend(SimpleProgressView, superClass);
|
757
758
|
|
758
759
|
function SimpleProgressView() {
|
759
|
-
|
760
|
-
return _ref1;
|
760
|
+
return SimpleProgressView.__super__.constructor.apply(this, arguments);
|
761
761
|
}
|
762
762
|
|
763
763
|
SimpleProgressView.prototype.build = function() {
|
@@ -768,19 +768,18 @@
|
|
768
768
|
SimpleProgressView.prototype.update = function(total, run) {
|
769
769
|
var percent;
|
770
770
|
percent = total ? Math.ceil((run * 100) / total) : 0;
|
771
|
-
return this.setHtml("progress-percent",
|
771
|
+
return this.setHtml("progress-percent", percent + "%");
|
772
772
|
};
|
773
773
|
|
774
774
|
return SimpleProgressView;
|
775
775
|
|
776
776
|
})(Teaspoon.Reporters.HTML.ProgressView);
|
777
777
|
|
778
|
-
Teaspoon.Reporters.HTML.RadialProgressView = (function(
|
779
|
-
|
778
|
+
Teaspoon.Reporters.HTML.RadialProgressView = (function(superClass) {
|
779
|
+
extend(RadialProgressView, superClass);
|
780
780
|
|
781
781
|
function RadialProgressView() {
|
782
|
-
|
783
|
-
return _ref2;
|
782
|
+
return RadialProgressView.__super__.constructor.apply(this, arguments);
|
784
783
|
}
|
785
784
|
|
786
785
|
RadialProgressView.supported = !!document.createElement("canvas").getContext;
|
@@ -808,7 +807,7 @@
|
|
808
807
|
RadialProgressView.prototype.update = function(total, run) {
|
809
808
|
var half, percent;
|
810
809
|
percent = total ? Math.ceil((run * 100) / total) : 0;
|
811
|
-
this.setHtml("progress-percent",
|
810
|
+
this.setHtml("progress-percent", percent + "%");
|
812
811
|
if (!this.ctx) {
|
813
812
|
return;
|
814
813
|
}
|
@@ -825,13 +824,13 @@
|
|
825
824
|
|
826
825
|
}).call(this);
|
827
826
|
(function() {
|
828
|
-
var
|
829
|
-
|
827
|
+
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
828
|
+
hasProp = {}.hasOwnProperty;
|
830
829
|
|
831
|
-
Teaspoon.Reporters.HTML.SpecView = (function(
|
830
|
+
Teaspoon.Reporters.HTML.SpecView = (function(superClass) {
|
832
831
|
var viewId;
|
833
832
|
|
834
|
-
|
833
|
+
extend(SpecView, superClass);
|
835
834
|
|
836
835
|
viewId = 0;
|
837
836
|
|
@@ -868,12 +867,12 @@
|
|
868
867
|
};
|
869
868
|
|
870
869
|
SpecView.prototype.buildErrors = function() {
|
871
|
-
var div, error, html,
|
870
|
+
var div, error, html, i, len, ref;
|
872
871
|
div = this.createEl("div");
|
873
872
|
html = "";
|
874
|
-
|
875
|
-
for (
|
876
|
-
error =
|
873
|
+
ref = this.spec.errors();
|
874
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
875
|
+
error = ref[i];
|
877
876
|
html += "<strong>" + (this.htmlSafe(error.message)) + "</strong><br/>" + (this.htmlSafe(error.stack || "Stack trace unavailable"));
|
878
877
|
}
|
879
878
|
div.innerHTML = html;
|
@@ -881,7 +880,7 @@
|
|
881
880
|
};
|
882
881
|
|
883
882
|
SpecView.prototype.updateState = function(state, elapsed) {
|
884
|
-
var classes, result
|
883
|
+
var base, classes, result;
|
885
884
|
result = this.spec.result();
|
886
885
|
classes = ["state-" + state];
|
887
886
|
if (elapsed > Teaspoon.slow) {
|
@@ -894,7 +893,7 @@
|
|
894
893
|
if (result.status !== "passed") {
|
895
894
|
this.buildErrors();
|
896
895
|
}
|
897
|
-
return typeof (
|
896
|
+
return typeof (base = this.parentView).updateState === "function" ? base.updateState(state) : void 0;
|
898
897
|
};
|
899
898
|
|
900
899
|
return SpecView;
|
@@ -903,11 +902,11 @@
|
|
903
902
|
|
904
903
|
}).call(this);
|
905
904
|
(function() {
|
906
|
-
var
|
907
|
-
|
905
|
+
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
906
|
+
hasProp = {}.hasOwnProperty;
|
908
907
|
|
909
|
-
Teaspoon.Reporters.HTML.FailureView = (function(
|
910
|
-
|
908
|
+
Teaspoon.Reporters.HTML.FailureView = (function(superClass) {
|
909
|
+
extend(FailureView, superClass);
|
911
910
|
|
912
911
|
function FailureView(spec) {
|
913
912
|
this.spec = spec;
|
@@ -915,12 +914,12 @@
|
|
915
914
|
}
|
916
915
|
|
917
916
|
FailureView.prototype.build = function() {
|
918
|
-
var error, html,
|
917
|
+
var error, html, i, len, ref;
|
919
918
|
FailureView.__super__.build.call(this, "spec");
|
920
919
|
html = "<h1 class=\"teaspoon-clearfix\"><a href=\"" + this.spec.link + "\">" + (this.htmlSafe(this.spec.fullDescription)) + "</a></h1>";
|
921
|
-
|
922
|
-
for (
|
923
|
-
error =
|
920
|
+
ref = this.spec.errors();
|
921
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
922
|
+
error = ref[i];
|
924
923
|
html += "<div><strong>" + (this.htmlSafe(error.message)) + "</strong><br/>" + (this.htmlSafe(error.stack || "Stack trace unavailable")) + "</div>";
|
925
924
|
}
|
926
925
|
return this.el.innerHTML = html;
|
@@ -932,18 +931,18 @@
|
|
932
931
|
|
933
932
|
}).call(this);
|
934
933
|
(function() {
|
935
|
-
var
|
936
|
-
|
934
|
+
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
935
|
+
hasProp = {}.hasOwnProperty;
|
937
936
|
|
938
|
-
Teaspoon.Reporters.HTML.SuiteView = (function(
|
937
|
+
Teaspoon.Reporters.HTML.SuiteView = (function(superClass) {
|
939
938
|
var viewId;
|
940
939
|
|
941
|
-
|
940
|
+
extend(SuiteView, superClass);
|
942
941
|
|
943
942
|
viewId = 0;
|
944
943
|
|
945
|
-
function SuiteView(
|
946
|
-
this.suite =
|
944
|
+
function SuiteView(suite1, reporter) {
|
945
|
+
this.suite = suite1;
|
947
946
|
this.reporter = reporter;
|
948
947
|
this.views = this.reporter.views;
|
949
948
|
this.suite.viewId = viewId += 1;
|
@@ -981,13 +980,13 @@
|
|
981
980
|
};
|
982
981
|
|
983
982
|
SuiteView.prototype.updateState = function(state) {
|
984
|
-
var
|
983
|
+
var base;
|
985
984
|
if (this.state === "failed") {
|
986
985
|
return;
|
987
986
|
}
|
988
|
-
this.el.className =
|
989
|
-
if (typeof (
|
990
|
-
|
987
|
+
this.el.className = (this.el.className.replace(/\s?state-\w+/, "")) + " state-" + state;
|
988
|
+
if (typeof (base = this.parentView).updateState === "function") {
|
989
|
+
base.updateState(state);
|
991
990
|
}
|
992
991
|
return this.state = state;
|
993
992
|
};
|
@@ -1004,11 +1003,11 @@
|
|
1004
1003
|
|
1005
1004
|
}).call(this);
|
1006
1005
|
(function() {
|
1007
|
-
var
|
1006
|
+
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
1008
1007
|
|
1009
1008
|
Teaspoon.Reporters.Console = (function() {
|
1010
1009
|
function Console() {
|
1011
|
-
this.reportRunnerResults =
|
1010
|
+
this.reportRunnerResults = bind(this.reportRunnerResults, this);
|
1012
1011
|
this.start = new Teaspoon.Date();
|
1013
1012
|
this.suites = {};
|
1014
1013
|
}
|
@@ -1022,22 +1021,22 @@
|
|
1022
1021
|
};
|
1023
1022
|
|
1024
1023
|
Console.prototype.reportSuites = function() {
|
1025
|
-
var
|
1026
|
-
|
1027
|
-
|
1028
|
-
for (index =
|
1029
|
-
suite =
|
1024
|
+
var i, index, len, ref, results, suite;
|
1025
|
+
ref = this.spec.getParents();
|
1026
|
+
results = [];
|
1027
|
+
for (index = i = 0, len = ref.length; i < len; index = ++i) {
|
1028
|
+
suite = ref[index];
|
1030
1029
|
if (this.suites[suite.fullDescription]) {
|
1031
1030
|
continue;
|
1032
1031
|
}
|
1033
1032
|
this.suites[suite.fullDescription] = true;
|
1034
|
-
|
1033
|
+
results.push(this.log({
|
1035
1034
|
type: "suite",
|
1036
1035
|
label: suite.description,
|
1037
1036
|
level: index
|
1038
1037
|
}));
|
1039
1038
|
}
|
1040
|
-
return
|
1039
|
+
return results;
|
1041
1040
|
};
|
1042
1041
|
|
1043
1042
|
Console.prototype.reportSpecResults = function(spec) {
|
@@ -1077,13 +1076,13 @@
|
|
1077
1076
|
};
|
1078
1077
|
|
1079
1078
|
Console.prototype.trackFailure = function() {
|
1080
|
-
var error,
|
1079
|
+
var error, i, len, ref, result, results;
|
1081
1080
|
result = this.spec.result();
|
1082
|
-
|
1083
|
-
|
1084
|
-
for (
|
1085
|
-
error =
|
1086
|
-
|
1081
|
+
ref = this.spec.errors();
|
1082
|
+
results = [];
|
1083
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
1084
|
+
error = ref[i];
|
1085
|
+
results.push(this.log({
|
1087
1086
|
type: "spec",
|
1088
1087
|
suite: this.spec.suiteName,
|
1089
1088
|
label: this.spec.description,
|
@@ -1094,7 +1093,7 @@
|
|
1094
1093
|
trace: error.stack || error.message || "Stack Trace Unavailable"
|
1095
1094
|
}));
|
1096
1095
|
}
|
1097
|
-
return
|
1096
|
+
return results;
|
1098
1097
|
};
|
1099
1098
|
|
1100
1099
|
Console.prototype.reportRunnerResults = function() {
|
@@ -1120,15 +1119,15 @@
|
|
1120
1119
|
|
1121
1120
|
}).call(this);
|
1122
1121
|
(function() {
|
1123
|
-
var
|
1124
|
-
|
1125
|
-
|
1122
|
+
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
1123
|
+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
1124
|
+
hasProp = {}.hasOwnProperty;
|
1126
1125
|
|
1127
|
-
Teaspoon.Reporters.Console = (function(
|
1128
|
-
|
1126
|
+
Teaspoon.Reporters.Console = (function(superClass) {
|
1127
|
+
extend(Console, superClass);
|
1129
1128
|
|
1130
1129
|
function Console(env) {
|
1131
|
-
this.reportSpecResults =
|
1130
|
+
this.reportSpecResults = bind(this.reportSpecResults, this);
|
1132
1131
|
Console.__super__.constructor.apply(this, arguments);
|
1133
1132
|
env.log(this.reportSpecResults);
|
1134
1133
|
env.testDone(this.reportSpecResults);
|
@@ -1161,17 +1160,16 @@
|
|
1161
1160
|
|
1162
1161
|
}).call(this);
|
1163
1162
|
(function() {
|
1164
|
-
var
|
1165
|
-
|
1166
|
-
|
1167
|
-
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
1163
|
+
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
1164
|
+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
1165
|
+
hasProp = {}.hasOwnProperty;
|
1168
1166
|
|
1169
|
-
Teaspoon.Reporters.HTML = (function(
|
1170
|
-
|
1167
|
+
Teaspoon.Reporters.HTML = (function(superClass) {
|
1168
|
+
extend(HTML, superClass);
|
1171
1169
|
|
1172
1170
|
function HTML(env) {
|
1173
|
-
this.reportRunnerResults =
|
1174
|
-
this.reportSpecResults =
|
1171
|
+
this.reportRunnerResults = bind(this.reportRunnerResults, this);
|
1172
|
+
this.reportSpecResults = bind(this.reportSpecResults, this);
|
1175
1173
|
HTML.__super__.constructor.apply(this, arguments);
|
1176
1174
|
env.log(this.reportSpecResults);
|
1177
1175
|
env.testDone(this.reportSpecResults);
|
@@ -1214,21 +1212,20 @@
|
|
1214
1212
|
|
1215
1213
|
})(Teaspoon.Reporters.HTML);
|
1216
1214
|
|
1217
|
-
Teaspoon.Reporters.HTML.SpecView = (function(
|
1218
|
-
|
1215
|
+
Teaspoon.Reporters.HTML.SpecView = (function(superClass) {
|
1216
|
+
extend(SpecView, superClass);
|
1219
1217
|
|
1220
1218
|
function SpecView() {
|
1221
|
-
|
1222
|
-
return _ref;
|
1219
|
+
return SpecView.__super__.constructor.apply(this, arguments);
|
1223
1220
|
}
|
1224
1221
|
|
1225
1222
|
SpecView.prototype.buildErrors = function() {
|
1226
|
-
var div, error, html,
|
1223
|
+
var div, error, html, i, len, ref;
|
1227
1224
|
div = this.createEl("div");
|
1228
1225
|
html = "";
|
1229
|
-
|
1230
|
-
for (
|
1231
|
-
error =
|
1226
|
+
ref = this.spec.errors();
|
1227
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
1228
|
+
error = ref[i];
|
1232
1229
|
html += "<strong>" + error.message + "</strong><br/>" + (this.htmlSafe(error.stack || "Stack trace unavailable")) + "<br/>";
|
1233
1230
|
}
|
1234
1231
|
div.innerHTML = html;
|
@@ -1253,21 +1250,20 @@
|
|
1253
1250
|
|
1254
1251
|
})(Teaspoon.Reporters.HTML.SpecView);
|
1255
1252
|
|
1256
|
-
Teaspoon.Reporters.HTML.FailureView = (function(
|
1257
|
-
|
1253
|
+
Teaspoon.Reporters.HTML.FailureView = (function(superClass) {
|
1254
|
+
extend(FailureView, superClass);
|
1258
1255
|
|
1259
1256
|
function FailureView() {
|
1260
|
-
|
1261
|
-
return _ref1;
|
1257
|
+
return FailureView.__super__.constructor.apply(this, arguments);
|
1262
1258
|
}
|
1263
1259
|
|
1264
1260
|
FailureView.prototype.build = function() {
|
1265
|
-
var error, html,
|
1261
|
+
var error, html, i, len, ref;
|
1266
1262
|
FailureView.__super__.build.call(this, "spec");
|
1267
1263
|
html = "<h1 class=\"teaspoon-clearfix\"><a href=\"" + this.spec.link + "\">" + (this.htmlSafe(this.spec.fullDescription)) + "</a></h1>";
|
1268
|
-
|
1269
|
-
for (
|
1270
|
-
error =
|
1264
|
+
ref = this.spec.errors();
|
1265
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
1266
|
+
error = ref[i];
|
1271
1267
|
html += "<div><strong>" + error.message + "</strong><br/>" + (this.htmlSafe(error.stack || "Stack trace unavailable")) + "</div>";
|
1272
1268
|
}
|
1273
1269
|
return this.el.innerHTML = html;
|
@@ -1277,8 +1273,8 @@
|
|
1277
1273
|
|
1278
1274
|
})(Teaspoon.Reporters.HTML.FailureView);
|
1279
1275
|
|
1280
|
-
Teaspoon.Reporters.HTML.SuiteView = (function(
|
1281
|
-
|
1276
|
+
Teaspoon.Reporters.HTML.SuiteView = (function(superClass) {
|
1277
|
+
extend(SuiteView, superClass);
|
1282
1278
|
|
1283
1279
|
function SuiteView(suite, reporter) {
|
1284
1280
|
this.suite = suite;
|
@@ -1295,15 +1291,15 @@
|
|
1295
1291
|
}).call(this);
|
1296
1292
|
(function() {
|
1297
1293
|
var env, originalReset,
|
1298
|
-
|
1299
|
-
|
1294
|
+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
1295
|
+
hasProp = {}.hasOwnProperty;
|
1300
1296
|
|
1301
1297
|
if (typeof QUnit === "undefined" || QUnit === null) {
|
1302
1298
|
throw new Teaspoon.Error('QUnit not found -- use `suite.use_framework :qunit` and adjust or remove the `suite.javascripts` directive.');
|
1303
1299
|
}
|
1304
1300
|
|
1305
|
-
Teaspoon.Runner = (function(
|
1306
|
-
|
1301
|
+
Teaspoon.Runner = (function(superClass) {
|
1302
|
+
extend(Runner, superClass);
|
1307
1303
|
|
1308
1304
|
function Runner() {
|
1309
1305
|
Runner.__super__.constructor.apply(this, arguments);
|
@@ -1321,9 +1317,9 @@
|
|
1321
1317
|
Teaspoon.Spec = (function() {
|
1322
1318
|
function Spec(spec) {
|
1323
1319
|
this.spec = spec;
|
1324
|
-
this.fullDescription =
|
1325
|
-
this.description =
|
1326
|
-
this.link = "?grep=" + (encodeURIComponent(
|
1320
|
+
this.fullDescription = this.spec.module + " " + this.spec.name;
|
1321
|
+
this.description = this.spec.name + " (" + this.spec.failed + ", " + this.spec.passed + ", " + this.spec.total + ")";
|
1322
|
+
this.link = "?grep=" + (encodeURIComponent(this.spec.module + ": " + this.spec.name));
|
1327
1323
|
this.parent = this.spec.module ? new Teaspoon.Suite({
|
1328
1324
|
description: this.spec.module
|
1329
1325
|
}) : null;
|
@@ -1333,23 +1329,24 @@
|
|
1333
1329
|
}
|
1334
1330
|
|
1335
1331
|
Spec.prototype.errors = function() {
|
1336
|
-
var
|
1332
|
+
var i, item, len, ref, results;
|
1337
1333
|
if (!this.spec.failed) {
|
1338
1334
|
return [];
|
1339
1335
|
}
|
1340
|
-
|
1341
|
-
|
1342
|
-
for (
|
1343
|
-
item =
|
1336
|
+
ref = this.spec.assertions;
|
1337
|
+
results = [];
|
1338
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
1339
|
+
item = ref[i];
|
1344
1340
|
if (item.result) {
|
1345
1341
|
continue;
|
1346
1342
|
}
|
1347
|
-
|
1343
|
+
this.provideFallbackMessage(item);
|
1344
|
+
results.push({
|
1348
1345
|
message: item.message,
|
1349
1346
|
stack: item.source
|
1350
1347
|
});
|
1351
1348
|
}
|
1352
|
-
return
|
1349
|
+
return results;
|
1353
1350
|
};
|
1354
1351
|
|
1355
1352
|
Spec.prototype.getParents = function() {
|
@@ -1371,6 +1368,17 @@
|
|
1371
1368
|
};
|
1372
1369
|
};
|
1373
1370
|
|
1371
|
+
Spec.prototype.provideFallbackMessage = function(item) {
|
1372
|
+
if (item.message) {
|
1373
|
+
return;
|
1374
|
+
}
|
1375
|
+
if (item.actual && item.expected) {
|
1376
|
+
return item.message || (item.message = "Expected " + (JSON.stringify(item.actual)) + " to equal " + (JSON.stringify(item.expected)));
|
1377
|
+
} else {
|
1378
|
+
return item.message = 'failed';
|
1379
|
+
}
|
1380
|
+
};
|
1381
|
+
|
1374
1382
|
return Spec;
|
1375
1383
|
|
1376
1384
|
})();
|