teaspoon 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/MIT.LICENSE +1 -1
  3. data/README.md +46 -377
  4. data/app/assets/javascripts/teaspoon-jasmine.js +200 -194
  5. data/app/assets/javascripts/teaspoon-mocha.js +183 -185
  6. data/app/assets/javascripts/teaspoon-qunit.js +201 -193
  7. data/app/assets/javascripts/teaspoon-teaspoon.js +10 -10
  8. data/app/assets/javascripts/teaspoon/base/fixture.coffee +0 -1
  9. data/app/assets/javascripts/teaspoon/base/hook.coffee +7 -6
  10. data/app/assets/javascripts/teaspoon/qunit.coffee +10 -0
  11. data/app/controllers/teaspoon/suite_controller.rb +3 -4
  12. data/app/views/teaspoon/suite/_boot.html.erb +1 -1
  13. data/app/views/teaspoon/suite/_boot_require_js.html.erb +1 -0
  14. data/bin/teaspoon +1 -1
  15. data/config/routes.rb +4 -14
  16. data/lib/generators/teaspoon/install/install_generator.rb +22 -11
  17. data/lib/generators/teaspoon/install/templates/jasmine/{env_comments.rb → env_comments.rb.tt} +10 -5
  18. data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee +5 -5
  19. data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.js +5 -5
  20. data/lib/generators/teaspoon/install/templates/mocha/{env_comments.rb → env_comments.rb.tt} +10 -5
  21. data/lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee +6 -5
  22. data/lib/generators/teaspoon/install/templates/mocha/spec_helper.js +6 -5
  23. data/lib/generators/teaspoon/install/templates/qunit/{env_comments.rb → env_comments.rb.tt} +10 -5
  24. data/lib/generators/teaspoon/install/templates/qunit/test_helper.coffee +5 -5
  25. data/lib/generators/teaspoon/install/templates/qunit/test_helper.js +5 -5
  26. data/lib/tasks/teaspoon.rake +1 -1
  27. data/lib/teaspoon/command_line.rb +37 -40
  28. data/lib/teaspoon/configuration.rb +27 -30
  29. data/lib/teaspoon/configuration.rb.orig +187 -0
  30. data/lib/teaspoon/console.rb +31 -17
  31. data/lib/teaspoon/coverage.rb +2 -3
  32. data/lib/teaspoon/deprecated.rb +13 -8
  33. data/lib/teaspoon/drivers/base.rb +2 -2
  34. data/lib/teaspoon/drivers/capybara_webkit_driver.rb +33 -0
  35. data/lib/teaspoon/drivers/phantomjs/runner.js +2 -2
  36. data/lib/teaspoon/drivers/phantomjs_driver.rb +13 -4
  37. data/lib/teaspoon/drivers/selenium_driver.rb +3 -5
  38. data/lib/teaspoon/engine.rb +33 -5
  39. data/lib/teaspoon/environment.rb +2 -4
  40. data/lib/teaspoon/exceptions.rb +8 -5
  41. data/lib/teaspoon/formatters/base.rb +39 -27
  42. data/lib/teaspoon/formatters/clean_formatter.rb +0 -1
  43. data/lib/teaspoon/formatters/description.rb +36 -0
  44. data/lib/teaspoon/formatters/documentation_formatter.rb +2 -2
  45. data/lib/teaspoon/formatters/json_formatter.rb +1 -2
  46. data/lib/teaspoon/formatters/junit_formatter.rb +20 -20
  47. data/lib/teaspoon/formatters/modules/report_module.rb +4 -4
  48. data/lib/teaspoon/formatters/pride_formatter.rb +0 -1
  49. data/lib/teaspoon/formatters/rspec_html_formatter.rb +463 -0
  50. data/lib/teaspoon/formatters/snowday_formatter.rb +0 -1
  51. data/lib/teaspoon/formatters/swayze_or_oprah_formatter.rb +5 -4
  52. data/lib/teaspoon/formatters/tap_formatter.rb +2 -3
  53. data/lib/teaspoon/formatters/tap_y_formatter.rb +20 -21
  54. data/lib/teaspoon/formatters/teamcity_formatter.rb +4 -5
  55. data/lib/teaspoon/instrumentation.rb +7 -7
  56. data/lib/teaspoon/result.rb +1 -3
  57. data/lib/teaspoon/runner.rb +1 -2
  58. data/lib/teaspoon/server.rb +2 -1
  59. data/lib/teaspoon/suite.rb +20 -17
  60. data/lib/teaspoon/utility.rb +1 -3
  61. data/lib/teaspoon/version.rb +1 -1
  62. data/spec/dummy/config/application.rb +14 -18
  63. data/spec/dummy/config/boot.rb +2 -6
  64. data/spec/dummy/config/environment.rb +3 -3
  65. data/spec/dummy/config/environments/development.rb +27 -13
  66. data/spec/dummy/config/environments/production.rb +79 -0
  67. data/spec/dummy/config/environments/test.rb +26 -13
  68. data/spec/dummy/config/routes.rb +1 -1
  69. data/spec/dummy/config/secrets.yml +22 -0
  70. data/spec/features/console_reporter_spec.rb +3 -8
  71. data/spec/features/hooks_spec.rb +17 -4
  72. data/spec/features/html_reporter_spec.rb +12 -1
  73. data/spec/features/install_generator_spec.rb +2 -3
  74. data/spec/features/instrumentation_spec.rb +11 -11
  75. data/spec/javascripts/teaspoon/base/teaspoon_spec.coffee +14 -1
  76. data/spec/spec_helper.rb +7 -4
  77. data/spec/teaspoon/command_line_spec.rb +19 -28
  78. data/spec/teaspoon/configuration_spec.rb +22 -14
  79. data/spec/teaspoon/console_spec.rb +79 -63
  80. data/spec/teaspoon/coverage_spec.rb +23 -23
  81. data/spec/teaspoon/drivers/capybara_webkit_driver_spec.rb +39 -0
  82. data/spec/teaspoon/drivers/phantomjs_driver_spec.rb +10 -5
  83. data/spec/teaspoon/drivers/selenium_driver_spec.rb +10 -10
  84. data/spec/teaspoon/environment_spec.rb +28 -20
  85. data/spec/teaspoon/exceptions_spec.rb +4 -4
  86. data/spec/teaspoon/exporter_spec.rb +28 -28
  87. data/spec/teaspoon/formatters/base_spec.rb +29 -29
  88. data/spec/teaspoon/formatters/clean_formatter_spec.rb +1 -1
  89. data/spec/teaspoon/formatters/documentation_formatter_spec.rb +1 -1
  90. data/spec/teaspoon/formatters/dot_formatter_spec.rb +1 -1
  91. data/spec/teaspoon/formatters/json_formatter_spec.rb +7 -7
  92. data/spec/teaspoon/formatters/junit_formatter_spec.rb +10 -10
  93. data/spec/teaspoon/formatters/pride_formatter_spec.rb +1 -1
  94. data/spec/teaspoon/formatters/rspec_html_formatter_spec.rb +107 -0
  95. data/spec/teaspoon/formatters/snowday_formatter_spec.rb +1 -1
  96. data/spec/teaspoon/formatters/tap_formatter_spec.rb +1 -1
  97. data/spec/teaspoon/formatters/tap_y_formatter_spec.rb +1 -1
  98. data/spec/teaspoon/formatters/teamcity_formatter_spec.rb +27 -27
  99. data/spec/teaspoon/instrumentation_spec.rb +35 -29
  100. data/spec/teaspoon/result_spec.rb +40 -36
  101. data/spec/teaspoon/runner_spec.rb +23 -20
  102. data/spec/teaspoon/server_spec.rb +19 -16
  103. data/spec/teaspoon/suite_spec.rb +23 -9
  104. data/spec/teaspoon_env.rb +7 -12
  105. data/test/javascripts/teaspoon/qunit/models_test.coffee +6 -2
  106. data/vendor/assets/javascripts/support/chai-1.10.0.js +4800 -0
  107. data/vendor/assets/javascripts/support/chai-jq-0.0.7.js +524 -0
  108. data/vendor/assets/javascripts/support/chai.js +4435 -4349
  109. metadata +57 -54
  110. data/app/assets/javascripts/teaspoon-angular.js +0 -1299
  111. data/app/assets/javascripts/teaspoon/angular.coffee +0 -55
  112. data/app/assets/javascripts/teaspoon/angular/reporters/console.coffee +0 -11
  113. data/app/assets/javascripts/teaspoon/angular/reporters/html.coffee +0 -21
  114. data/spec/javascripts/angular_helper.coffee +0 -5
  115. data/spec/javascripts/teaspoon/angular/models_aspec.coffee +0 -95
  116. data/spec/javascripts/teaspoon/angular/reporters/html_aspec.coffee +0 -9
  117. data/vendor/assets/javascripts/angular/1.0.5.js +0 -26195
  118. data/vendor/assets/javascripts/angular/MIT-LICENSE +0 -22
@@ -1,6 +1,6 @@
1
1
  (function() {
2
- var __hasProp = {}.hasOwnProperty,
3
- __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; };
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, parts, path, paths, _i, _j, _len, _len1;
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 (_i = 0, _len = paths.length; _i < _len; _i++) {
63
- path = paths[_i];
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 (_j = 0, _len1 = all.length; _j < _len1; _j++) {
70
- dep = all[_j];
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(_super) {
102
- __extends(Error, _super);
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 = "" + Teaspoon.root + "/fixtures";
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 name, param, params, value, _i, _len, _ref, _ref1;
129
+ var i, len, name, param, params, ref, ref1, value;
130
130
  params = {};
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];
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 __slice = [].slice;
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 url, urls, _i, _len, _results;
176
- urls = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
177
- _results = [];
178
- for (_i = 0, _len = urls.length; _i < _len; _i++) {
179
- url = urls[_i];
180
- _results.push(preload(url));
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 _results;
181
+ return results;
183
182
  };
184
183
 
185
184
  fixture.load = function() {
186
- var append, index, url, urls, _i, _j, _len, _results;
187
- urls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
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
- _results = [];
196
- for (index = _j = 0, _len = urls.length; _j < _len; index = ++_j) {
194
+ results = [];
195
+ for (index = j = 0, len = urls.length; j < len; index = ++j) {
197
196
  url = urls[index];
198
- _results.push(load(url, append || index > 0));
197
+ results.push(load(url, append || index > 0));
199
198
  }
200
- return _results;
199
+ return results;
201
200
  };
202
201
 
203
202
  fixture.set = function() {
204
- var append, html, htmls, index, _i, _j, _len, _results;
205
- htmls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++];
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
- _results = [];
214
- for (index = _j = 0, _len = htmls.length; _j < _len; index = ++_j) {
212
+ results = [];
213
+ for (index = j = 0, len = htmls.length; j < len; index = ++j) {
215
214
  html = htmls[index];
216
- _results.push(set(html, append || index > 0));
215
+ results.push(set(html, append || index > 0));
217
216
  }
218
- return _results;
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 _ref;
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 (_ref = document.body) != null ? _ref.appendChild(Teaspoon.fixture.el) : void 0;
302
+ return (ref = document.body) != null ? ref.appendChild(Teaspoon.fixture.el) : void 0;
304
303
  };
305
304
 
306
305
  cleanup = function() {
307
- var _base, _ref, _ref1;
308
- (_base = Teaspoon.fixture).el || (_base.el = document.getElementById("teaspoon-fixtures"));
309
- if ((_ref = Teaspoon.fixture.el) != null) {
310
- if ((_ref1 = _ref.parentNode) != null) {
311
- _ref1.removeChild(Teaspoon.fixture.el);
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", "" + Teaspoon.root + "/fixtures/" + url, false);
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
- }).call(this);
342
+ })();
344
343
 
345
344
  }).call(this);
346
345
  (function() {
347
- Teaspoon.hook = function(name, options) {
348
- var xhr, xhrRequest;
349
- if (options == null) {
350
- options = {};
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, options, callback) {
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(options['method'] || "GET", "" + Teaspoon.root + "/" + url, false);
374
- return xhr.send(options['payload']);
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("" + Teaspoon.suites.active + "/" + name, options, function() {
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 _base;
420
+ var base;
418
421
  this.elements || (this.elements = {});
419
- return (_base = this.elements)[id] || (_base[id] = document.getElementById("teaspoon-" + id));
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 __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
461
- __hasProp = {}.hasOwnProperty,
462
- __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; };
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(_super) {
465
- __extends(HTML, _super);
467
+ Teaspoon.Reporters.HTML = (function(superClass) {
468
+ extend(HTML, superClass);
466
469
 
467
470
  function HTML() {
468
- this.changeSuite = __bind(this.changeSuite, this);
469
- this.toggleConfig = __bind(this.toggleConfig, this);
470
- this.reportRunnerResults = __bind(this.reportRunnerResults, this);
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 _ref;
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 ((_ref = this.findEl("suite-select")) != null) {
502
- _ref.onchange = this.changeSuite;
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, options, path, selected, suite, _i, _len, _ref;
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
- _ref = Teaspoon.suites.all;
529
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
530
- suite = _ref[_i];
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 "" + (((new Teaspoon.Date().getTime() - this.start) / 1000).toFixed(3)) + "s";
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, result, _ref, _ref1;
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 (_ref = this.reportView) != null ? _ref.updateState("passed", elapsed) : void 0;
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 ((_ref1 = this.reportView) != null) {
615
- _ref1.updateState("failed", elapsed);
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, value, _ref, _results;
630
- _ref = this.config;
631
- _results = [];
632
- for (key in _ref) {
633
- value = _ref[key];
634
- _results.push(this.setClass(key, value ? "active" : ""));
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 _results;
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 _ref;
679
- if (((_ref = window.localStorage) != null ? _ref.setItem : void 0) != null) {
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 = "" + name + "=" + (escape(JSON.stringify(value))) + "; expires=" + (date.toUTCString()) + "; path=/;";
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 _ref, _ref1, _ref2,
720
- __hasProp = {}.hasOwnProperty,
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(_super) {
724
- __extends(ProgressView, _super);
725
+ Teaspoon.Reporters.HTML.ProgressView = (function(superClass) {
726
+ extend(ProgressView, superClass);
725
727
 
726
728
  function ProgressView() {
727
- _ref = ProgressView.__super__.constructor.apply(this, arguments);
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(_super) {
756
- __extends(SimpleProgressView, _super);
756
+ Teaspoon.Reporters.HTML.SimpleProgressView = (function(superClass) {
757
+ extend(SimpleProgressView, superClass);
757
758
 
758
759
  function SimpleProgressView() {
759
- _ref1 = SimpleProgressView.__super__.constructor.apply(this, arguments);
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", "" + 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(_super) {
779
- __extends(RadialProgressView, _super);
778
+ Teaspoon.Reporters.HTML.RadialProgressView = (function(superClass) {
779
+ extend(RadialProgressView, superClass);
780
780
 
781
781
  function RadialProgressView() {
782
- _ref2 = RadialProgressView.__super__.constructor.apply(this, arguments);
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", "" + 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 __hasProp = {}.hasOwnProperty,
829
- __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; };
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(_super) {
830
+ Teaspoon.Reporters.HTML.SpecView = (function(superClass) {
832
831
  var viewId;
833
832
 
834
- __extends(SpecView, _super);
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, _i, _len, _ref;
870
+ var div, error, html, i, len, ref;
872
871
  div = this.createEl("div");
873
872
  html = "";
874
- _ref = this.spec.errors();
875
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
876
- error = _ref[_i];
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, _base;
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 (_base = this.parentView).updateState === "function" ? _base.updateState(state) : void 0;
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 __hasProp = {}.hasOwnProperty,
907
- __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; };
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(_super) {
910
- __extends(FailureView, _super);
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, _i, _len, _ref;
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
- _ref = this.spec.errors();
922
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
923
- error = _ref[_i];
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 __hasProp = {}.hasOwnProperty,
936
- __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; };
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(_super) {
937
+ Teaspoon.Reporters.HTML.SuiteView = (function(superClass) {
939
938
  var viewId;
940
939
 
941
- __extends(SuiteView, _super);
940
+ extend(SuiteView, superClass);
942
941
 
943
942
  viewId = 0;
944
943
 
945
- function SuiteView(suite, reporter) {
946
- this.suite = 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 _base;
983
+ var base;
985
984
  if (this.state === "failed") {
986
985
  return;
987
986
  }
988
- this.el.className = "" + (this.el.className.replace(/\s?state-\w+/, "")) + " state-" + state;
989
- if (typeof (_base = this.parentView).updateState === "function") {
990
- _base.updateState(state);
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 __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
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 = __bind(this.reportRunnerResults, this);
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 index, suite, _i, _len, _ref, _results;
1026
- _ref = this.spec.getParents();
1027
- _results = [];
1028
- for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
1029
- suite = _ref[index];
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
- _results.push(this.log({
1033
+ results.push(this.log({
1035
1034
  type: "suite",
1036
1035
  label: suite.description,
1037
1036
  level: index
1038
1037
  }));
1039
1038
  }
1040
- return _results;
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, result, _i, _len, _ref, _results;
1079
+ var error, i, len, ref, result, results;
1081
1080
  result = this.spec.result();
1082
- _ref = this.spec.errors();
1083
- _results = [];
1084
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1085
- error = _ref[_i];
1086
- _results.push(this.log({
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 _results;
1096
+ return results;
1098
1097
  };
1099
1098
 
1100
1099
  Console.prototype.reportRunnerResults = function() {
@@ -1120,16 +1119,14 @@
1120
1119
 
1121
1120
  }).call(this);
1122
1121
  (function() {
1123
- var _ref,
1124
- __hasProp = {}.hasOwnProperty,
1125
- __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; };
1122
+ 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; },
1123
+ hasProp = {}.hasOwnProperty;
1126
1124
 
1127
- Teaspoon.Reporters.HTML = (function(_super) {
1128
- __extends(HTML, _super);
1125
+ Teaspoon.Reporters.HTML = (function(superClass) {
1126
+ extend(HTML, superClass);
1129
1127
 
1130
1128
  function HTML() {
1131
- _ref = HTML.__super__.constructor.apply(this, arguments);
1132
- return _ref;
1129
+ return HTML.__super__.constructor.apply(this, arguments);
1133
1130
  }
1134
1131
 
1135
1132
  HTML.prototype.readConfig = function() {
@@ -1150,16 +1147,16 @@
1150
1147
 
1151
1148
  }).call(this);
1152
1149
  (function() {
1153
- var env, _ref,
1154
- __hasProp = {}.hasOwnProperty,
1155
- __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; };
1150
+ var env,
1151
+ 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; },
1152
+ hasProp = {}.hasOwnProperty;
1156
1153
 
1157
1154
  if (typeof jasmine === "undefined" || jasmine === null) {
1158
1155
  throw new Teaspoon.Error('Jasmine not found -- use `suite.use_framework :jasmine` and adjust or remove the `suite.javascripts` directive.');
1159
1156
  }
1160
1157
 
1161
- Teaspoon.Runner = (function(_super) {
1162
- __extends(Runner, _super);
1158
+ Teaspoon.Runner = (function(superClass) {
1159
+ extend(Runner, superClass);
1163
1160
 
1164
1161
  function Runner() {
1165
1162
  Runner.__super__.constructor.apply(this, arguments);
@@ -1194,8 +1191,8 @@
1194
1191
  })(Teaspoon.Runner);
1195
1192
 
1196
1193
  Teaspoon.Spec = (function() {
1197
- function Spec(spec) {
1198
- this.spec = spec;
1194
+ function Spec(spec1) {
1195
+ this.spec = spec1;
1199
1196
  this.fullDescription = this.spec.getFullName();
1200
1197
  this.description = this.spec.description;
1201
1198
  this.link = "?grep=" + (encodeURIComponent(this.fullDescription));
@@ -1206,23 +1203,23 @@
1206
1203
  }
1207
1204
 
1208
1205
  Spec.prototype.errors = function() {
1209
- var item, _i, _len, _ref, _results;
1206
+ var i, item, len, ref, results1;
1210
1207
  if (!this.spec.results) {
1211
1208
  return [];
1212
1209
  }
1213
- _ref = this.spec.results().getItems();
1214
- _results = [];
1215
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1216
- item = _ref[_i];
1210
+ ref = this.spec.results().getItems();
1211
+ results1 = [];
1212
+ for (i = 0, len = ref.length; i < len; i++) {
1213
+ item = ref[i];
1217
1214
  if (item.passed()) {
1218
1215
  continue;
1219
1216
  }
1220
- _results.push({
1217
+ results1.push({
1221
1218
  message: item.message,
1222
1219
  stack: item.trace.stack
1223
1220
  });
1224
1221
  }
1225
- return _results;
1222
+ return results1;
1226
1223
  };
1227
1224
 
1228
1225
  Spec.prototype.getParents = function() {
@@ -1274,58 +1271,67 @@
1274
1271
 
1275
1272
  })();
1276
1273
 
1277
- Teaspoon.fixture = (function(_super) {
1278
- __extends(fixture, _super);
1274
+ Teaspoon.fixture = (function(superClass) {
1275
+ extend(fixture, superClass);
1279
1276
 
1280
1277
  function fixture() {
1281
- _ref = fixture.__super__.constructor.apply(this, arguments);
1282
- return _ref;
1278
+ return fixture.__super__.constructor.apply(this, arguments);
1283
1279
  }
1284
1280
 
1285
1281
  window.fixture = fixture;
1286
1282
 
1287
1283
  fixture.load = function() {
1288
- var args,
1289
- _this = this;
1284
+ var args;
1290
1285
  args = arguments;
1291
1286
  if (!(env.currentSuite || env.currentSpec)) {
1292
1287
  throw "Teaspoon can't load fixtures outside of describe.";
1293
1288
  }
1294
1289
  if (env.currentSuite) {
1295
- env.beforeEach(function() {
1296
- return fixture.__super__.constructor.load.apply(_this, args);
1297
- });
1298
- env.afterEach(function() {
1299
- return _this.cleanup();
1300
- });
1290
+ env.beforeEach((function(_this) {
1291
+ return function() {
1292
+ return fixture.__super__.constructor.load.apply(_this, args);
1293
+ };
1294
+ })(this));
1295
+ env.afterEach((function(_this) {
1296
+ return function() {
1297
+ return _this.cleanup();
1298
+ };
1299
+ })(this));
1301
1300
  return fixture.__super__.constructor.load.apply(this, arguments);
1302
1301
  } else {
1303
- env.currentSpec.after(function() {
1304
- return _this.cleanup();
1305
- });
1302
+ env.currentSpec.after((function(_this) {
1303
+ return function() {
1304
+ return _this.cleanup();
1305
+ };
1306
+ })(this));
1306
1307
  return fixture.__super__.constructor.load.apply(this, arguments);
1307
1308
  }
1308
1309
  };
1309
1310
 
1310
1311
  fixture.set = function() {
1311
- var args,
1312
- _this = this;
1312
+ var args;
1313
1313
  args = arguments;
1314
1314
  if (!(env.currentSuite || env.currentSpec)) {
1315
1315
  throw "Teaspoon can't load fixtures outside of describe.";
1316
1316
  }
1317
1317
  if (env.currentSuite) {
1318
- env.beforeEach(function() {
1319
- return fixture.__super__.constructor.set.apply(_this, args);
1320
- });
1321
- env.afterEach(function() {
1322
- return _this.cleanup();
1323
- });
1318
+ env.beforeEach((function(_this) {
1319
+ return function() {
1320
+ return fixture.__super__.constructor.set.apply(_this, args);
1321
+ };
1322
+ })(this));
1323
+ env.afterEach((function(_this) {
1324
+ return function() {
1325
+ return _this.cleanup();
1326
+ };
1327
+ })(this));
1324
1328
  return fixture.__super__.constructor.set.apply(this, arguments);
1325
1329
  } else {
1326
- env.currentSpec.after(function() {
1327
- return _this.cleanup();
1328
- });
1330
+ env.currentSpec.after((function(_this) {
1331
+ return function() {
1332
+ return _this.cleanup();
1333
+ };
1334
+ })(this));
1329
1335
  return fixture.__super__.constructor.set.apply(this, arguments);
1330
1336
  }
1331
1337
  };