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
metadata CHANGED
@@ -1,39 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teaspoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jejacks0n
8
8
  - jayzes
9
9
  - jedschneider
10
+ - mikepack
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2014-04-19 00:00:00.000000000 Z
14
+ date: 2015-02-25 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: railties
17
18
  requirement: !ruby/object:Gem::Requirement
18
19
  requirements:
19
- - - '>='
20
+ - - ">="
20
21
  - !ruby/object:Gem::Version
21
22
  version: 3.2.5
22
- - - <
23
+ - - "<"
23
24
  - !ruby/object:Gem::Version
24
25
  version: '5'
25
26
  type: :runtime
26
27
  prerelease: false
27
28
  version_requirements: !ruby/object:Gem::Requirement
28
29
  requirements:
29
- - - '>='
30
+ - - ">="
30
31
  - !ruby/object:Gem::Version
31
32
  version: 3.2.5
32
- - - <
33
+ - - "<"
33
34
  - !ruby/object:Gem::Version
34
35
  version: '5'
35
36
  description: Run Javascript tests using Jasmine, Mocha or QUnit in the browser or
36
- headlessly using PhantomJS or with Selenium Webdriver
37
+ headless using PhantomJS, Selenium Webdriver, or Capybara Webkit
37
38
  email:
38
39
  - info@modeset.com
39
40
  executables:
@@ -41,35 +42,33 @@ executables:
41
42
  extensions: []
42
43
  extra_rdoc_files: []
43
44
  files:
44
- - app/assets/javascripts/teaspoon/angular/reporters/console.coffee
45
- - app/assets/javascripts/teaspoon/angular/reporters/html.coffee
46
- - app/assets/javascripts/teaspoon/angular.coffee
45
+ - MIT.LICENSE
46
+ - README.md
47
+ - app/assets/javascripts/teaspoon-jasmine.js
48
+ - app/assets/javascripts/teaspoon-mocha.js
49
+ - app/assets/javascripts/teaspoon-qunit.js
50
+ - app/assets/javascripts/teaspoon-teaspoon.js
47
51
  - app/assets/javascripts/teaspoon/base/fixture.coffee
48
52
  - app/assets/javascripts/teaspoon/base/hook.coffee
49
53
  - app/assets/javascripts/teaspoon/base/reporters/console.coffee
54
+ - app/assets/javascripts/teaspoon/base/reporters/html.coffee
50
55
  - app/assets/javascripts/teaspoon/base/reporters/html/base_view.coffee
51
56
  - app/assets/javascripts/teaspoon/base/reporters/html/failure_view.coffee
52
57
  - app/assets/javascripts/teaspoon/base/reporters/html/progress_view.coffee
53
58
  - app/assets/javascripts/teaspoon/base/reporters/html/spec_view.coffee
54
59
  - app/assets/javascripts/teaspoon/base/reporters/html/suite_view.coffee
55
60
  - app/assets/javascripts/teaspoon/base/reporters/html/template.coffee
56
- - app/assets/javascripts/teaspoon/base/reporters/html.coffee
57
61
  - app/assets/javascripts/teaspoon/base/runner.coffee
58
62
  - app/assets/javascripts/teaspoon/base/teaspoon.coffee
59
- - app/assets/javascripts/teaspoon/jasmine/reporters/html.coffee
60
63
  - app/assets/javascripts/teaspoon/jasmine.coffee
64
+ - app/assets/javascripts/teaspoon/jasmine/reporters/html.coffee
65
+ - app/assets/javascripts/teaspoon/mocha.coffee
61
66
  - app/assets/javascripts/teaspoon/mocha/reporters/console.coffee
62
67
  - app/assets/javascripts/teaspoon/mocha/reporters/html.coffee
63
- - app/assets/javascripts/teaspoon/mocha.coffee
68
+ - app/assets/javascripts/teaspoon/qunit.coffee
64
69
  - app/assets/javascripts/teaspoon/qunit/reporters/console.coffee
65
70
  - app/assets/javascripts/teaspoon/qunit/reporters/html.coffee
66
- - app/assets/javascripts/teaspoon/qunit.coffee
67
71
  - app/assets/javascripts/teaspoon/teaspoon.coffee
68
- - app/assets/javascripts/teaspoon-angular.js
69
- - app/assets/javascripts/teaspoon-jasmine.js
70
- - app/assets/javascripts/teaspoon-mocha.js
71
- - app/assets/javascripts/teaspoon-qunit.js
72
- - app/assets/javascripts/teaspoon-teaspoon.js
73
72
  - app/assets/stylesheets/teaspoon.css
74
73
  - app/controllers/teaspoon/suite_controller.rb
75
74
  - app/views/teaspoon/suite/_body.html.erb
@@ -77,30 +76,34 @@ files:
77
76
  - app/views/teaspoon/suite/_boot_require_js.html.erb
78
77
  - app/views/teaspoon/suite/index.html.erb
79
78
  - app/views/teaspoon/suite/show.html.erb
79
+ - bin/teaspoon
80
80
  - config/routes.rb
81
- - lib/generators/teaspoon/install/install_generator.rb
82
81
  - lib/generators/teaspoon/install/POST_INSTALL
82
+ - lib/generators/teaspoon/install/install_generator.rb
83
83
  - lib/generators/teaspoon/install/templates/_body.html.erb
84
84
  - lib/generators/teaspoon/install/templates/_boot.html.erb
85
85
  - lib/generators/teaspoon/install/templates/jasmine/env.rb
86
- - lib/generators/teaspoon/install/templates/jasmine/env_comments.rb
86
+ - lib/generators/teaspoon/install/templates/jasmine/env_comments.rb.tt
87
87
  - lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee
88
88
  - lib/generators/teaspoon/install/templates/jasmine/spec_helper.js
89
89
  - lib/generators/teaspoon/install/templates/mocha/env.rb
90
- - lib/generators/teaspoon/install/templates/mocha/env_comments.rb
90
+ - lib/generators/teaspoon/install/templates/mocha/env_comments.rb.tt
91
91
  - lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee
92
92
  - lib/generators/teaspoon/install/templates/mocha/spec_helper.js
93
93
  - lib/generators/teaspoon/install/templates/qunit/env.rb
94
- - lib/generators/teaspoon/install/templates/qunit/env_comments.rb
94
+ - lib/generators/teaspoon/install/templates/qunit/env_comments.rb.tt
95
95
  - lib/generators/teaspoon/install/templates/qunit/test_helper.coffee
96
96
  - lib/generators/teaspoon/install/templates/qunit/test_helper.js
97
97
  - lib/tasks/teaspoon.rake
98
+ - lib/teaspoon.rb
98
99
  - lib/teaspoon/command_line.rb
99
100
  - lib/teaspoon/configuration.rb
101
+ - lib/teaspoon/configuration.rb.orig
100
102
  - lib/teaspoon/console.rb
101
103
  - lib/teaspoon/coverage.rb
102
104
  - lib/teaspoon/deprecated.rb
103
105
  - lib/teaspoon/drivers/base.rb
106
+ - lib/teaspoon/drivers/capybara_webkit_driver.rb
104
107
  - lib/teaspoon/drivers/phantomjs/runner.js
105
108
  - lib/teaspoon/drivers/phantomjs_driver.rb
106
109
  - lib/teaspoon/drivers/selenium_driver.rb
@@ -110,12 +113,14 @@ files:
110
113
  - lib/teaspoon/exporter.rb
111
114
  - lib/teaspoon/formatters/base.rb
112
115
  - lib/teaspoon/formatters/clean_formatter.rb
116
+ - lib/teaspoon/formatters/description.rb
113
117
  - lib/teaspoon/formatters/documentation_formatter.rb
114
118
  - lib/teaspoon/formatters/dot_formatter.rb
115
119
  - lib/teaspoon/formatters/json_formatter.rb
116
120
  - lib/teaspoon/formatters/junit_formatter.rb
117
121
  - lib/teaspoon/formatters/modules/report_module.rb
118
122
  - lib/teaspoon/formatters/pride_formatter.rb
123
+ - lib/teaspoon/formatters/rspec_html_formatter.rb
119
124
  - lib/teaspoon/formatters/snowday_formatter.rb
120
125
  - lib/teaspoon/formatters/swayze_or_oprah_formatter.rb
121
126
  - lib/teaspoon/formatters/tap_formatter.rb
@@ -128,28 +133,6 @@ files:
128
133
  - lib/teaspoon/suite.rb
129
134
  - lib/teaspoon/utility.rb
130
135
  - lib/teaspoon/version.rb
131
- - lib/teaspoon.rb
132
- - vendor/assets/javascripts/angular/1.0.5.js
133
- - vendor/assets/javascripts/angular/MIT-LICENSE
134
- - vendor/assets/javascripts/jasmine/1.3.1.js
135
- - vendor/assets/javascripts/jasmine/2.0.0.js
136
- - vendor/assets/javascripts/jasmine/MIT.LICENSE
137
- - vendor/assets/javascripts/mocha/1.10.0.js
138
- - vendor/assets/javascripts/mocha/1.17.1.js
139
- - vendor/assets/javascripts/mocha/MIT.LICENSE
140
- - vendor/assets/javascripts/qunit/1.12.0.js
141
- - vendor/assets/javascripts/qunit/1.14.0.js
142
- - vendor/assets/javascripts/qunit/MIT.LICENSE
143
- - vendor/assets/javascripts/support/bind-poly.js
144
- - vendor/assets/javascripts/support/chai.js
145
- - vendor/assets/javascripts/support/expect.js
146
- - vendor/assets/javascripts/support/jasmine-jquery-1.7.0.js
147
- - vendor/assets/javascripts/support/jasmine-jquery-2.0.0.js
148
- - vendor/assets/javascripts/support/sinon-chai.js
149
- - vendor/assets/javascripts/support/sinon.js
150
- - bin/teaspoon
151
- - MIT.LICENSE
152
- - README.md
153
136
  - spec/dummy/Rakefile
154
137
  - spec/dummy/app/assets/javascripts/instrumented1.coffee
155
138
  - spec/dummy/app/assets/javascripts/instrumented2.coffee
@@ -162,8 +145,10 @@ files:
162
145
  - spec/dummy/config/boot.rb
163
146
  - spec/dummy/config/environment.rb
164
147
  - spec/dummy/config/environments/development.rb
148
+ - spec/dummy/config/environments/production.rb
165
149
  - spec/dummy/config/environments/test.rb
166
150
  - spec/dummy/config/routes.rb
151
+ - spec/dummy/config/secrets.yml
167
152
  - spec/dummy/log/.gitkeep
168
153
  - spec/dummy/public/favicon.ico
169
154
  - spec/dummy/script/rails
@@ -173,7 +158,6 @@ files:
173
158
  - spec/features/install_generator_spec.rb
174
159
  - spec/features/instrumentation_spec.rb
175
160
  - spec/fixtures/coverage.json
176
- - spec/javascripts/angular_helper.coffee
177
161
  - spec/javascripts/fixtures/_body.html.erb
178
162
  - spec/javascripts/fixtures/fixture.html.haml
179
163
  - spec/javascripts/fixtures/fixture.json
@@ -183,8 +167,6 @@ files:
183
167
  - spec/javascripts/stylesheets/stylesheet.css.scss
184
168
  - spec/javascripts/support/json2.js
185
169
  - spec/javascripts/support/support.js.coffee
186
- - spec/javascripts/teaspoon/angular/models_aspec.coffee
187
- - spec/javascripts/teaspoon/angular/reporters/html_aspec.coffee
188
170
  - spec/javascripts/teaspoon/base/fixture_spec.coffee
189
171
  - spec/javascripts/teaspoon/base/reporters/console_spec.coffee
190
172
  - spec/javascripts/teaspoon/base/reporters/html/base_view_spec.coffee
@@ -216,6 +198,7 @@ files:
216
198
  - spec/teaspoon/console_spec.rb
217
199
  - spec/teaspoon/coverage_spec.rb
218
200
  - spec/teaspoon/drivers/base_spec.rb
201
+ - spec/teaspoon/drivers/capybara_webkit_driver_spec.rb
219
202
  - spec/teaspoon/drivers/phantomjs_driver_spec.rb
220
203
  - spec/teaspoon/drivers/selenium_driver_spec.rb
221
204
  - spec/teaspoon/engine_spec.rb
@@ -229,6 +212,7 @@ files:
229
212
  - spec/teaspoon/formatters/json_formatter_spec.rb
230
213
  - spec/teaspoon/formatters/junit_formatter_spec.rb
231
214
  - spec/teaspoon/formatters/pride_formatter_spec.rb
215
+ - spec/teaspoon/formatters/rspec_html_formatter_spec.rb
232
216
  - spec/teaspoon/formatters/snowday_formatter_spec.rb
233
217
  - spec/teaspoon/formatters/tap_formatter_spec.rb
234
218
  - spec/teaspoon/formatters/tap_y_formatter_spec.rb
@@ -248,6 +232,24 @@ files:
248
232
  - test/javascripts/teaspoon/qunit/reporters/html/suite_view_test.coffee
249
233
  - test/javascripts/teaspoon/qunit/reporters/html_test.coffee
250
234
  - test/javascripts/teaspoon/qunit/runner_test.coffee
235
+ - vendor/assets/javascripts/jasmine/1.3.1.js
236
+ - vendor/assets/javascripts/jasmine/2.0.0.js
237
+ - vendor/assets/javascripts/jasmine/MIT.LICENSE
238
+ - vendor/assets/javascripts/mocha/1.10.0.js
239
+ - vendor/assets/javascripts/mocha/1.17.1.js
240
+ - vendor/assets/javascripts/mocha/MIT.LICENSE
241
+ - vendor/assets/javascripts/qunit/1.12.0.js
242
+ - vendor/assets/javascripts/qunit/1.14.0.js
243
+ - vendor/assets/javascripts/qunit/MIT.LICENSE
244
+ - vendor/assets/javascripts/support/bind-poly.js
245
+ - vendor/assets/javascripts/support/chai-1.10.0.js
246
+ - vendor/assets/javascripts/support/chai-jq-0.0.7.js
247
+ - vendor/assets/javascripts/support/chai.js
248
+ - vendor/assets/javascripts/support/expect.js
249
+ - vendor/assets/javascripts/support/jasmine-jquery-1.7.0.js
250
+ - vendor/assets/javascripts/support/jasmine-jquery-2.0.0.js
251
+ - vendor/assets/javascripts/support/sinon-chai.js
252
+ - vendor/assets/javascripts/support/sinon.js
251
253
  homepage: https://github.com/modeset/teaspoon
252
254
  licenses:
253
255
  - MIT
@@ -258,17 +260,17 @@ require_paths:
258
260
  - lib
259
261
  required_ruby_version: !ruby/object:Gem::Requirement
260
262
  requirements:
261
- - - '>='
263
+ - - ">="
262
264
  - !ruby/object:Gem::Version
263
265
  version: '0'
264
266
  required_rubygems_version: !ruby/object:Gem::Requirement
265
267
  requirements:
266
- - - '>='
268
+ - - ">="
267
269
  - !ruby/object:Gem::Version
268
270
  version: '0'
269
271
  requirements: []
270
272
  rubyforge_project:
271
- rubygems_version: 2.0.14
273
+ rubygems_version: 2.4.5
272
274
  signing_key:
273
275
  specification_version: 4
274
276
  summary: 'Teaspoon: A Javascript test runner built on top of Rails'
@@ -285,8 +287,10 @@ test_files:
285
287
  - spec/dummy/config/boot.rb
286
288
  - spec/dummy/config/environment.rb
287
289
  - spec/dummy/config/environments/development.rb
290
+ - spec/dummy/config/environments/production.rb
288
291
  - spec/dummy/config/environments/test.rb
289
292
  - spec/dummy/config/routes.rb
293
+ - spec/dummy/config/secrets.yml
290
294
  - spec/dummy/log/.gitkeep
291
295
  - spec/dummy/public/favicon.ico
292
296
  - spec/dummy/script/rails
@@ -296,7 +300,6 @@ test_files:
296
300
  - spec/features/install_generator_spec.rb
297
301
  - spec/features/instrumentation_spec.rb
298
302
  - spec/fixtures/coverage.json
299
- - spec/javascripts/angular_helper.coffee
300
303
  - spec/javascripts/fixtures/_body.html.erb
301
304
  - spec/javascripts/fixtures/fixture.html.haml
302
305
  - spec/javascripts/fixtures/fixture.json
@@ -306,8 +309,6 @@ test_files:
306
309
  - spec/javascripts/stylesheets/stylesheet.css.scss
307
310
  - spec/javascripts/support/json2.js
308
311
  - spec/javascripts/support/support.js.coffee
309
- - spec/javascripts/teaspoon/angular/models_aspec.coffee
310
- - spec/javascripts/teaspoon/angular/reporters/html_aspec.coffee
311
312
  - spec/javascripts/teaspoon/base/fixture_spec.coffee
312
313
  - spec/javascripts/teaspoon/base/reporters/console_spec.coffee
313
314
  - spec/javascripts/teaspoon/base/reporters/html/base_view_spec.coffee
@@ -339,6 +340,7 @@ test_files:
339
340
  - spec/teaspoon/console_spec.rb
340
341
  - spec/teaspoon/coverage_spec.rb
341
342
  - spec/teaspoon/drivers/base_spec.rb
343
+ - spec/teaspoon/drivers/capybara_webkit_driver_spec.rb
342
344
  - spec/teaspoon/drivers/phantomjs_driver_spec.rb
343
345
  - spec/teaspoon/drivers/selenium_driver_spec.rb
344
346
  - spec/teaspoon/engine_spec.rb
@@ -352,6 +354,7 @@ test_files:
352
354
  - spec/teaspoon/formatters/json_formatter_spec.rb
353
355
  - spec/teaspoon/formatters/junit_formatter_spec.rb
354
356
  - spec/teaspoon/formatters/pride_formatter_spec.rb
357
+ - spec/teaspoon/formatters/rspec_html_formatter_spec.rb
355
358
  - spec/teaspoon/formatters/snowday_formatter_spec.rb
356
359
  - spec/teaspoon/formatters/tap_formatter_spec.rb
357
360
  - spec/teaspoon/formatters/tap_y_formatter_spec.rb
@@ -1,1299 +0,0 @@
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; };
4
-
5
- this.Teaspoon = (function() {
6
- function Teaspoon() {}
7
-
8
- Teaspoon.defer = false;
9
-
10
- Teaspoon.slow = 75;
11
-
12
- Teaspoon.root = window.location.pathname.replace(/\/+(index\.html)?$/, "").replace(/\/[^\/]*$/, "");
13
-
14
- Teaspoon.started = false;
15
-
16
- Teaspoon.finished = false;
17
-
18
- Teaspoon.Reporters = {};
19
-
20
- Teaspoon.Date = Date;
21
-
22
- Teaspoon.location = window.location;
23
-
24
- Teaspoon.messages = [];
25
-
26
- Teaspoon.execute = function() {
27
- if (Teaspoon.defer) {
28
- Teaspoon.defer = false;
29
- return;
30
- }
31
- if (Teaspoon.started) {
32
- Teaspoon.reload();
33
- }
34
- Teaspoon.started = true;
35
- return new Teaspoon.Runner();
36
- };
37
-
38
- Teaspoon.reload = function() {
39
- return window.location.reload();
40
- };
41
-
42
- Teaspoon.onWindowLoad = function(method) {
43
- var originalOnload;
44
- originalOnload = window.onload;
45
- return window.onload = function() {
46
- if (originalOnload && originalOnload.call) {
47
- originalOnload();
48
- }
49
- return method();
50
- };
51
- };
52
-
53
- Teaspoon.resolveDependenciesFromParams = function(all) {
54
- var dep, deps, file, parts, path, paths, _i, _j, _len, _len1;
55
- if (all == null) {
56
- all = [];
57
- }
58
- deps = [];
59
- if ((paths = Teaspoon.location.search.match(/[\?&]file(\[\])?=[^&\?]*/gi)) === null) {
60
- return all;
61
- }
62
- for (_i = 0, _len = paths.length; _i < _len; _i++) {
63
- path = paths[_i];
64
- parts = decodeURIComponent(path.replace(/\+/g, " ")).match(/\/(.+)\.(js|js.coffee|coffee)$/i);
65
- if (parts === null) {
66
- continue;
67
- }
68
- file = parts[1].substr(parts[1].lastIndexOf("/") + 1);
69
- for (_j = 0, _len1 = all.length; _j < _len1; _j++) {
70
- dep = all[_j];
71
- if (dep.indexOf(file) >= 0) {
72
- deps.push(dep);
73
- }
74
- }
75
- }
76
- return deps;
77
- };
78
-
79
- Teaspoon.log = function() {
80
- var e;
81
- Teaspoon.messages.push(arguments[0]);
82
- try {
83
- return console.log.apply(console, arguments);
84
- } catch (_error) {
85
- e = _error;
86
- throw new Error("Unable to use console.log for logging");
87
- }
88
- };
89
-
90
- Teaspoon.getMessages = function() {
91
- var messages;
92
- messages = Teaspoon.messages;
93
- Teaspoon.messages = [];
94
- return messages;
95
- };
96
-
97
- return Teaspoon;
98
-
99
- })();
100
-
101
- Teaspoon.Error = (function(_super) {
102
- __extends(Error, _super);
103
-
104
- function Error(message) {
105
- this.name = "TeaspoonError";
106
- this.message = message || "";
107
- }
108
-
109
- return Error;
110
-
111
- })(Error);
112
-
113
- }).call(this);
114
- (function() {
115
- Teaspoon.Runner = (function() {
116
- Runner.run = false;
117
-
118
- function Runner() {
119
- if (this.constructor.run) {
120
- return;
121
- }
122
- this.constructor.run = true;
123
- this.fixturePath = "" + Teaspoon.root + "/fixtures";
124
- this.params = Teaspoon.params = this.getParams();
125
- this.setup();
126
- }
127
-
128
- Runner.prototype.getParams = function() {
129
- var name, param, params, value, _i, _len, _ref, _ref1;
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];
135
- params[decodeURIComponent(name)] = decodeURIComponent(value);
136
- }
137
- return params;
138
- };
139
-
140
- Runner.prototype.getReporter = function() {
141
- if (this.params["reporter"]) {
142
- return Teaspoon.Reporters[this.params["reporter"]];
143
- } else {
144
- if (window.navigator.userAgent.match(/PhantomJS/)) {
145
- return Teaspoon.Reporters.Console;
146
- } else {
147
- return Teaspoon.Reporters.HTML;
148
- }
149
- }
150
- };
151
-
152
- Runner.prototype.setup = function() {};
153
-
154
- return Runner;
155
-
156
- })();
157
-
158
- }).call(this);
159
- (function() {
160
- var __slice = [].slice;
161
-
162
- Teaspoon.fixture = (function() {
163
- var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest,
164
- _this = this;
165
-
166
- fixture.cache = {};
167
-
168
- fixture.el = null;
169
-
170
- fixture.$el = null;
171
-
172
- fixture.json = [];
173
-
174
- 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));
181
- }
182
- return _results;
183
- };
184
-
185
- 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++];
188
- if (append == null) {
189
- append = false;
190
- }
191
- if (typeof append !== "boolean") {
192
- urls.push(append);
193
- append = false;
194
- }
195
- _results = [];
196
- for (index = _j = 0, _len = urls.length; _j < _len; index = ++_j) {
197
- url = urls[index];
198
- _results.push(load(url, append || index > 0));
199
- }
200
- return _results;
201
- };
202
-
203
- 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++];
206
- if (append == null) {
207
- append = false;
208
- }
209
- if (typeof append !== "boolean") {
210
- htmls.push(append);
211
- append = false;
212
- }
213
- _results = [];
214
- for (index = _j = 0, _len = htmls.length; _j < _len; index = ++_j) {
215
- html = htmls[index];
216
- _results.push(set(html, append || index > 0));
217
- }
218
- return _results;
219
- };
220
-
221
- fixture.cleanup = function() {
222
- return cleanup();
223
- };
224
-
225
- function fixture() {
226
- Teaspoon.fixture.load.apply(window, arguments);
227
- }
228
-
229
- xhr = null;
230
-
231
- preload = function(url) {
232
- return load(url, false, true);
233
- };
234
-
235
- load = function(url, append, preload) {
236
- var cached, value;
237
- if (preload == null) {
238
- preload = false;
239
- }
240
- if (cached = Teaspoon.fixture.cache[url]) {
241
- return loadComplete(url, cached.type, cached.content, append, preload);
242
- }
243
- value = null;
244
- xhrRequest(url, function() {
245
- if (xhr.readyState !== 4) {
246
- return;
247
- }
248
- if (xhr.status !== 200) {
249
- throw "Unable to load fixture \"" + url + "\".";
250
- }
251
- return value = loadComplete(url, xhr.getResponseHeader("content-type"), xhr.responseText, append, preload);
252
- });
253
- return value;
254
- };
255
-
256
- loadComplete = function(url, type, content, append, preload) {
257
- Teaspoon.fixture.cache[url] = {
258
- type: type,
259
- content: content
260
- };
261
- if (type.match(/application\/json;/)) {
262
- return fixture.json[fixture.json.push(JSON.parse(content)) - 1];
263
- }
264
- if (preload) {
265
- return content;
266
- }
267
- if (append) {
268
- addContent(content);
269
- } else {
270
- putContent(content);
271
- }
272
- return Teaspoon.fixture.el;
273
- };
274
-
275
- set = function(content, append) {
276
- if (append) {
277
- return addContent(content);
278
- } else {
279
- return putContent(content);
280
- }
281
- };
282
-
283
- putContent = function(content) {
284
- cleanup();
285
- create();
286
- return Teaspoon.fixture.el.innerHTML = content;
287
- };
288
-
289
- addContent = function(content) {
290
- if (!Teaspoon.fixture.el) {
291
- create();
292
- }
293
- return Teaspoon.fixture.el.innerHTML += content;
294
- };
295
-
296
- create = function() {
297
- var _ref;
298
- Teaspoon.fixture.el = document.createElement("div");
299
- if (typeof window.$ === 'function') {
300
- Teaspoon.fixture.$el = $(Teaspoon.fixture.el);
301
- }
302
- Teaspoon.fixture.el.id = "teaspoon-fixtures";
303
- return (_ref = document.body) != null ? _ref.appendChild(Teaspoon.fixture.el) : void 0;
304
- };
305
-
306
- 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);
312
- }
313
- }
314
- return Teaspoon.fixture.el = null;
315
- };
316
-
317
- xhrRequest = function(url, callback) {
318
- var e;
319
- if (window.XMLHttpRequest) {
320
- xhr = new XMLHttpRequest();
321
- } else if (window.ActiveXObject) {
322
- try {
323
- xhr = new ActiveXObject("Msxml2.XMLHTTP");
324
- } catch (_error) {
325
- e = _error;
326
- try {
327
- xhr = new ActiveXObject("Microsoft.XMLHTTP");
328
- } catch (_error) {
329
- e = _error;
330
- }
331
- }
332
- }
333
- if (!xhr) {
334
- throw "Unable to make Ajax Request";
335
- }
336
- xhr.onreadystatechange = callback;
337
- xhr.open("GET", "" + Teaspoon.root + "/fixtures/" + url, false);
338
- return xhr.send();
339
- };
340
-
341
- return fixture;
342
-
343
- }).call(this);
344
-
345
- }).call(this);
346
- (function() {
347
- Teaspoon.hook = function(name, options) {
348
- var xhr, xhrRequest;
349
- if (options == null) {
350
- options = {};
351
- }
352
- xhr = null;
353
- xhrRequest = function(url, options, callback) {
354
- var e;
355
- if (window.XMLHttpRequest) {
356
- xhr = new XMLHttpRequest();
357
- } else if (window.ActiveXObject) {
358
- try {
359
- xhr = new ActiveXObject("Msxml2.XMLHTTP");
360
- } catch (_error) {
361
- e = _error;
362
- try {
363
- xhr = new ActiveXObject("Microsoft.XMLHTTP");
364
- } catch (_error) {
365
- e = _error;
366
- }
367
- }
368
- }
369
- if (!xhr) {
370
- throw "Unable to make Ajax Request";
371
- }
372
- xhr.onreadystatechange = callback;
373
- xhr.open(options['method'] || "GET", "" + Teaspoon.root + "/" + url, false);
374
- return xhr.send(options['payload']);
375
- };
376
- return xhrRequest("" + Teaspoon.suites.active + "/" + name, options, function() {
377
- if (xhr.readyState !== 4) {
378
- return;
379
- }
380
- if (xhr.status !== 200) {
381
- throw "Unable to call hook \"" + url + "\".";
382
- }
383
- });
384
- };
385
-
386
- }).call(this);
387
- (function() {
388
- Teaspoon.Reporters.BaseView = (function() {
389
- function BaseView() {
390
- this.elements = {};
391
- this.build();
392
- }
393
-
394
- BaseView.prototype.build = function(className) {
395
- return this.el = this.createEl("li", className);
396
- };
397
-
398
- BaseView.prototype.appendTo = function(el) {
399
- return el.appendChild(this.el);
400
- };
401
-
402
- BaseView.prototype.append = function(el) {
403
- return this.el.appendChild(el);
404
- };
405
-
406
- BaseView.prototype.createEl = function(type, className) {
407
- var el;
408
- if (className == null) {
409
- className = "";
410
- }
411
- el = document.createElement(type);
412
- el.className = className;
413
- return el;
414
- };
415
-
416
- BaseView.prototype.findEl = function(id) {
417
- var _base;
418
- this.elements || (this.elements = {});
419
- return (_base = this.elements)[id] || (_base[id] = document.getElementById("teaspoon-" + id));
420
- };
421
-
422
- BaseView.prototype.setText = function(id, value) {
423
- var el;
424
- el = this.findEl(id);
425
- return el.innerHTML = value;
426
- };
427
-
428
- BaseView.prototype.setHtml = function(id, value, add) {
429
- var el;
430
- if (add == null) {
431
- add = false;
432
- }
433
- el = this.findEl(id);
434
- if (add) {
435
- return el.innerHTML += value;
436
- } else {
437
- return el.innerHTML = value;
438
- }
439
- };
440
-
441
- BaseView.prototype.setClass = function(id, value) {
442
- var el;
443
- el = this.findEl(id);
444
- return el.className = value;
445
- };
446
-
447
- BaseView.prototype.htmlSafe = function(str) {
448
- var el;
449
- el = document.createElement("div");
450
- el.appendChild(document.createTextNode(str));
451
- return el.innerHTML;
452
- };
453
-
454
- return BaseView;
455
-
456
- })();
457
-
458
- }).call(this);
459
- (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
-
464
- Teaspoon.Reporters.HTML = (function(_super) {
465
- __extends(HTML, _super);
466
-
467
- 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.start = new Teaspoon.Date().getTime();
472
- this.config = {
473
- "use-catch": true,
474
- "build-full-report": false,
475
- "display-progress": true
476
- };
477
- this.total = {
478
- exist: 0,
479
- run: 0,
480
- passes: 0,
481
- failures: 0,
482
- skipped: 0
483
- };
484
- this.views = {
485
- specs: {},
486
- suites: {}
487
- };
488
- this.filters = [];
489
- this.setFilters();
490
- this.readConfig();
491
- HTML.__super__.constructor.apply(this, arguments);
492
- }
493
-
494
- HTML.prototype.build = function() {
495
- var _ref;
496
- this.buildLayout();
497
- this.setText("env-info", this.envInfo());
498
- this.setText("version", Teaspoon.version);
499
- this.findEl("toggles").onclick = this.toggleConfig;
500
- this.findEl("suites").innerHTML = this.buildSuiteSelect();
501
- if ((_ref = this.findEl("suite-select")) != null) {
502
- _ref.onchange = this.changeSuite;
503
- }
504
- this.el = this.findEl("report-all");
505
- this.showConfiguration();
506
- this.buildProgress();
507
- return this.buildFilters();
508
- };
509
-
510
- HTML.prototype.buildLayout = function() {
511
- var el;
512
- el = this.createEl("div");
513
- el.id = "teaspoon-interface";
514
- el.innerHTML = Teaspoon.Reporters.HTML.template();
515
- return document.body.appendChild(el);
516
- };
517
-
518
- HTML.prototype.buildSuiteSelect = function() {
519
- var filename, options, path, selected, suite, _i, _len, _ref;
520
- if (Teaspoon.suites.all.length === 1) {
521
- return "";
522
- }
523
- filename = "";
524
- if (/index\.html$/.test(window.location.pathname)) {
525
- filename = "/index.html";
526
- }
527
- options = [];
528
- _ref = Teaspoon.suites.all;
529
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
530
- suite = _ref[_i];
531
- path = [Teaspoon.root, suite].join("/");
532
- selected = Teaspoon.suites.active === suite ? " selected" : "";
533
- options.push("<option" + selected + " value=\"" + path + filename + "\">" + suite + "</option>");
534
- }
535
- return "<select id=\"teaspoon-suite-select\">" + (options.join("")) + "</select>";
536
- };
537
-
538
- HTML.prototype.buildProgress = function() {
539
- this.progress = Teaspoon.Reporters.HTML.ProgressView.create(this.config["display-progress"]);
540
- return this.progress.appendTo(this.findEl("progress"));
541
- };
542
-
543
- HTML.prototype.buildFilters = function() {
544
- if (this.filters.length) {
545
- this.setClass("filter", "teaspoon-filtered");
546
- }
547
- return this.setHtml("filter-list", "<li>" + (this.filters.join("</li><li>")), true);
548
- };
549
-
550
- HTML.prototype.reportRunnerStarting = function(runner) {
551
- this.total.exist = runner.total || (typeof runner.specs === "function" ? runner.specs().length : void 0) || 0;
552
- if (this.total.exist) {
553
- return this.setText("stats-duration", "...");
554
- }
555
- };
556
-
557
- HTML.prototype.reportSpecStarting = function(spec) {
558
- spec = new Teaspoon.Spec(spec);
559
- if (this.config["build-full-report"]) {
560
- this.reportView = new Teaspoon.Reporters.HTML.SpecView(spec, this);
561
- }
562
- return this.specStart = new Teaspoon.Date().getTime();
563
- };
564
-
565
- HTML.prototype.reportSpecResults = function(spec) {
566
- this.total.run += 1;
567
- this.updateProgress();
568
- return this.updateStatus(spec);
569
- };
570
-
571
- HTML.prototype.reportRunnerResults = function() {
572
- if (!this.total.run) {
573
- return;
574
- }
575
- this.setText("stats-duration", this.elapsedTime());
576
- if (!this.total.failures) {
577
- this.setStatus("passed");
578
- }
579
- this.setText("stats-passes", this.total.passes);
580
- this.setText("stats-failures", this.total.failures);
581
- if (this.total.run < this.total.exist) {
582
- this.total.skipped = this.total.exist - this.total.run;
583
- this.total.run = this.total.exist;
584
- }
585
- this.setText("stats-skipped", this.total.skipped);
586
- return this.updateProgress();
587
- };
588
-
589
- HTML.prototype.elapsedTime = function() {
590
- return "" + (((new Teaspoon.Date().getTime() - this.start) / 1000).toFixed(3)) + "s";
591
- };
592
-
593
- HTML.prototype.updateStat = function(name, value) {
594
- if (!this.config["display-progress"]) {
595
- return;
596
- }
597
- return this.setText("stats-" + name, value);
598
- };
599
-
600
- HTML.prototype.updateStatus = function(spec) {
601
- var elapsed, result, _ref, _ref1;
602
- spec = new Teaspoon.Spec(spec);
603
- result = spec.result();
604
- if (result.skipped || result.status === "pending") {
605
- this.updateStat("skipped", this.total.skipped += 1);
606
- return;
607
- }
608
- elapsed = new Teaspoon.Date().getTime() - this.specStart;
609
- if (result.status === "passed") {
610
- this.updateStat("passes", this.total.passes += 1);
611
- return (_ref = this.reportView) != null ? _ref.updateState("passed", elapsed) : void 0;
612
- } else {
613
- this.updateStat("failures", this.total.failures += 1);
614
- if ((_ref1 = this.reportView) != null) {
615
- _ref1.updateState("failed", elapsed);
616
- }
617
- if (!this.config["build-full-report"]) {
618
- new Teaspoon.Reporters.HTML.FailureView(spec).appendTo(this.findEl("report-failures"));
619
- }
620
- return this.setStatus("failed");
621
- }
622
- };
623
-
624
- HTML.prototype.updateProgress = function() {
625
- return this.progress.update(this.total.exist, this.total.run);
626
- };
627
-
628
- 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" : ""));
635
- }
636
- return _results;
637
- };
638
-
639
- HTML.prototype.setStatus = function(status) {
640
- return document.body.className = "teaspoon-" + status;
641
- };
642
-
643
- HTML.prototype.setFilters = function() {
644
- if (Teaspoon.params["file"]) {
645
- this.filters.push("by file: " + Teaspoon.params["file"]);
646
- }
647
- if (Teaspoon.params["grep"]) {
648
- return this.filters.push("by match: " + Teaspoon.params["grep"]);
649
- }
650
- };
651
-
652
- HTML.prototype.readConfig = function() {
653
- var config;
654
- if (config = this.store("teaspoon")) {
655
- return this.config = config;
656
- }
657
- };
658
-
659
- HTML.prototype.toggleConfig = function(e) {
660
- var button, name;
661
- button = e.target;
662
- if (button.tagName.toLowerCase() !== "button") {
663
- return;
664
- }
665
- name = button.getAttribute("id").replace(/^teaspoon-/, "");
666
- this.config[name] = !this.config[name];
667
- this.store("teaspoon", this.config);
668
- return Teaspoon.reload();
669
- };
670
-
671
- HTML.prototype.changeSuite = function(e) {
672
- var options;
673
- options = e.target.options;
674
- return window.location.href = options[options.selectedIndex].value;
675
- };
676
-
677
- HTML.prototype.store = function(name, value) {
678
- var _ref;
679
- if (((_ref = window.localStorage) != null ? _ref.setItem : void 0) != null) {
680
- return this.localstore(name, value);
681
- } else {
682
- return this.cookie(name, value);
683
- }
684
- };
685
-
686
- HTML.prototype.cookie = function(name, value) {
687
- var date, match;
688
- if (value == null) {
689
- value = void 0;
690
- }
691
- if (value === void 0) {
692
- name = name.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
693
- match = document.cookie.match(new RegExp("(?:^|;)\\s?" + name + "=(.*?)(?:;|$)", "i"));
694
- return match && JSON.parse(unescape(match[1]).split(" ")[0]);
695
- } else {
696
- date = new Teaspoon.Date();
697
- date.setDate(date.getDate() + 365);
698
- return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; expires=" + (date.toUTCString()) + "; path=/;";
699
- }
700
- };
701
-
702
- HTML.prototype.localstore = function(name, value) {
703
- if (value == null) {
704
- value = void 0;
705
- }
706
- if (value === void 0) {
707
- return JSON.parse(unescape(localStorage.getItem(name)));
708
- } else {
709
- return localStorage.setItem(name, escape(JSON.stringify(value)));
710
- }
711
- };
712
-
713
- return HTML;
714
-
715
- })(Teaspoon.Reporters.BaseView);
716
-
717
- }).call(this);
718
- (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
-
723
- Teaspoon.Reporters.HTML.ProgressView = (function(_super) {
724
- __extends(ProgressView, _super);
725
-
726
- function ProgressView() {
727
- _ref = ProgressView.__super__.constructor.apply(this, arguments);
728
- return _ref;
729
- }
730
-
731
- ProgressView.create = function(displayProgress) {
732
- if (displayProgress == null) {
733
- displayProgress = true;
734
- }
735
- if (!displayProgress) {
736
- return new Teaspoon.Reporters.HTML.ProgressView();
737
- }
738
- if (Teaspoon.Reporters.HTML.RadialProgressView.supported) {
739
- return new Teaspoon.Reporters.HTML.RadialProgressView();
740
- } else {
741
- return new Teaspoon.Reporters.HTML.SimpleProgressView();
742
- }
743
- };
744
-
745
- ProgressView.prototype.build = function() {
746
- return this.el = this.createEl("div", "teaspoon-indicator teaspoon-logo");
747
- };
748
-
749
- ProgressView.prototype.update = function() {};
750
-
751
- return ProgressView;
752
-
753
- })(Teaspoon.Reporters.BaseView);
754
-
755
- Teaspoon.Reporters.HTML.SimpleProgressView = (function(_super) {
756
- __extends(SimpleProgressView, _super);
757
-
758
- function SimpleProgressView() {
759
- _ref1 = SimpleProgressView.__super__.constructor.apply(this, arguments);
760
- return _ref1;
761
- }
762
-
763
- SimpleProgressView.prototype.build = function() {
764
- this.el = this.createEl("div", "simple-progress");
765
- return this.el.innerHTML = "<em id=\"teaspoon-progress-percent\">0%</em>\n<span id=\"teaspoon-progress-span\" class=\"teaspoon-indicator\"></span>";
766
- };
767
-
768
- SimpleProgressView.prototype.update = function(total, run) {
769
- var percent;
770
- percent = total ? Math.ceil((run * 100) / total) : 0;
771
- return this.setHtml("progress-percent", "" + percent + "%");
772
- };
773
-
774
- return SimpleProgressView;
775
-
776
- })(Teaspoon.Reporters.HTML.ProgressView);
777
-
778
- Teaspoon.Reporters.HTML.RadialProgressView = (function(_super) {
779
- __extends(RadialProgressView, _super);
780
-
781
- function RadialProgressView() {
782
- _ref2 = RadialProgressView.__super__.constructor.apply(this, arguments);
783
- return _ref2;
784
- }
785
-
786
- RadialProgressView.supported = !!document.createElement("canvas").getContext;
787
-
788
- RadialProgressView.prototype.build = function() {
789
- this.el = this.createEl("div", "teaspoon-indicator radial-progress");
790
- return this.el.innerHTML = "<canvas id=\"teaspoon-progress-canvas\"></canvas>\n<em id=\"teaspoon-progress-percent\">0%</em>";
791
- };
792
-
793
- RadialProgressView.prototype.appendTo = function() {
794
- var canvas, e;
795
- RadialProgressView.__super__.appendTo.apply(this, arguments);
796
- this.size = 80;
797
- try {
798
- canvas = this.findEl("progress-canvas");
799
- canvas.width = canvas.height = canvas.style.width = canvas.style.height = this.size;
800
- this.ctx = canvas.getContext("2d");
801
- this.ctx.strokeStyle = "#fff";
802
- return this.ctx.lineWidth = 1.5;
803
- } catch (_error) {
804
- e = _error;
805
- }
806
- };
807
-
808
- RadialProgressView.prototype.update = function(total, run) {
809
- var half, percent;
810
- percent = total ? Math.ceil((run * 100) / total) : 0;
811
- this.setHtml("progress-percent", "" + percent + "%");
812
- if (!this.ctx) {
813
- return;
814
- }
815
- half = this.size / 2;
816
- this.ctx.clearRect(0, 0, this.size, this.size);
817
- this.ctx.beginPath();
818
- this.ctx.arc(half, half, half - 1, 0, Math.PI * 2 * (percent / 100), false);
819
- return this.ctx.stroke();
820
- };
821
-
822
- return RadialProgressView;
823
-
824
- })(Teaspoon.Reporters.HTML.ProgressView);
825
-
826
- }).call(this);
827
- (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; };
830
-
831
- Teaspoon.Reporters.HTML.SpecView = (function(_super) {
832
- var viewId;
833
-
834
- __extends(SpecView, _super);
835
-
836
- viewId = 0;
837
-
838
- function SpecView(spec, reporter) {
839
- this.spec = spec;
840
- this.reporter = reporter;
841
- this.views = this.reporter.views;
842
- this.spec.viewId = viewId += 1;
843
- this.views.specs[this.spec.viewId] = this;
844
- SpecView.__super__.constructor.apply(this, arguments);
845
- }
846
-
847
- SpecView.prototype.build = function() {
848
- var classes;
849
- classes = ["spec"];
850
- if (this.spec.pending) {
851
- classes.push("state-pending");
852
- }
853
- SpecView.__super__.build.call(this, classes.join(" "));
854
- this.el.innerHTML = "<a href=\"" + this.spec.link + "\">" + (this.htmlSafe(this.spec.description)) + "</a>";
855
- this.parentView = this.buildParent();
856
- return this.parentView.append(this.el);
857
- };
858
-
859
- SpecView.prototype.buildParent = function() {
860
- var parent, view;
861
- parent = this.spec.parent;
862
- if (parent.viewId) {
863
- return this.views.suites[parent.viewId];
864
- } else {
865
- view = new Teaspoon.Reporters.HTML.SuiteView(parent, this.reporter);
866
- return this.views.suites[view.suite.viewId] = view;
867
- }
868
- };
869
-
870
- SpecView.prototype.buildErrors = function() {
871
- var div, error, html, _i, _len, _ref;
872
- div = this.createEl("div");
873
- html = "";
874
- _ref = this.spec.errors();
875
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
876
- error = _ref[_i];
877
- html += "<strong>" + (this.htmlSafe(error.message)) + "</strong><br/>" + (this.htmlSafe(error.stack || "Stack trace unavailable"));
878
- }
879
- div.innerHTML = html;
880
- return this.append(div);
881
- };
882
-
883
- SpecView.prototype.updateState = function(state, elapsed) {
884
- var classes, result, _base;
885
- result = this.spec.result();
886
- classes = ["state-" + state];
887
- if (elapsed > Teaspoon.slow) {
888
- classes.push("slow");
889
- }
890
- if (state !== "failed") {
891
- this.el.innerHTML += "<span>" + elapsed + "ms</span>";
892
- }
893
- this.el.className = classes.join(" ");
894
- if (result.status !== "passed") {
895
- this.buildErrors();
896
- }
897
- return typeof (_base = this.parentView).updateState === "function" ? _base.updateState(state) : void 0;
898
- };
899
-
900
- return SpecView;
901
-
902
- })(Teaspoon.Reporters.BaseView);
903
-
904
- }).call(this);
905
- (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; };
908
-
909
- Teaspoon.Reporters.HTML.FailureView = (function(_super) {
910
- __extends(FailureView, _super);
911
-
912
- function FailureView(spec) {
913
- this.spec = spec;
914
- FailureView.__super__.constructor.apply(this, arguments);
915
- }
916
-
917
- FailureView.prototype.build = function() {
918
- var error, html, _i, _len, _ref;
919
- FailureView.__super__.build.call(this, "spec");
920
- 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];
924
- html += "<div><strong>" + (this.htmlSafe(error.message)) + "</strong><br/>" + (this.htmlSafe(error.stack || "Stack trace unavailable")) + "</div>";
925
- }
926
- return this.el.innerHTML = html;
927
- };
928
-
929
- return FailureView;
930
-
931
- })(Teaspoon.Reporters.BaseView);
932
-
933
- }).call(this);
934
- (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; };
937
-
938
- Teaspoon.Reporters.HTML.SuiteView = (function(_super) {
939
- var viewId;
940
-
941
- __extends(SuiteView, _super);
942
-
943
- viewId = 0;
944
-
945
- function SuiteView(suite, reporter) {
946
- this.suite = suite;
947
- this.reporter = reporter;
948
- this.views = this.reporter.views;
949
- this.suite.viewId = viewId += 1;
950
- this.views.suites[this.suite.viewId] = this;
951
- this.suite = new Teaspoon.Suite(suite);
952
- SuiteView.__super__.constructor.apply(this, arguments);
953
- }
954
-
955
- SuiteView.prototype.build = function() {
956
- SuiteView.__super__.build.call(this, "suite");
957
- this.el.innerHTML = "<h1><a href=\"" + this.suite.link + "\">" + (this.htmlSafe(this.suite.description)) + "</a></h1>";
958
- this.parentView = this.buildParent();
959
- return this.parentView.append(this.el);
960
- };
961
-
962
- SuiteView.prototype.buildParent = function() {
963
- var parent, view;
964
- parent = this.suite.parent;
965
- if (!parent) {
966
- return this.reporter;
967
- }
968
- if (parent.viewId) {
969
- return this.views.suites[parent.viewId];
970
- } else {
971
- view = new Teaspoon.Reporters.HTML.SuiteView(parent, this.reporter);
972
- return this.views.suites[view.suite.viewId] = view;
973
- }
974
- };
975
-
976
- SuiteView.prototype.append = function(el) {
977
- if (!this.ol) {
978
- SuiteView.__super__.append.call(this, this.ol = this.createEl("ol"));
979
- }
980
- return this.ol.appendChild(el);
981
- };
982
-
983
- SuiteView.prototype.updateState = function(state) {
984
- var _base;
985
- if (this.state === "failed") {
986
- return;
987
- }
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);
991
- }
992
- return this.state = state;
993
- };
994
-
995
- return SuiteView;
996
-
997
- })(Teaspoon.Reporters.BaseView);
998
-
999
- }).call(this);
1000
- (function() {
1001
- Teaspoon.Reporters.HTML.template = function() {
1002
- return "<div class=\"teaspoon-clearfix\">\n <div id=\"teaspoon-title\">\n <h1><a href=\"" + Teaspoon.root + "\" id=\"teaspoon-root-link\">Teaspoon</a></h1>\n <ul>\n <li>version: <b id=\"teaspoon-version\"></b></li>\n <li id=\"teaspoon-env-info\"></li>\n </ul>\n </div>\n <div id=\"teaspoon-progress\"></div>\n <ul id=\"teaspoon-stats\">\n <li>passes: <b id=\"teaspoon-stats-passes\">0</b></li>\n <li>failures: <b id=\"teaspoon-stats-failures\">0</b></li>\n <li>skipped: <b id=\"teaspoon-stats-skipped\">0</b></li>\n <li>duration: <b id=\"teaspoon-stats-duration\">&infin;</b></li>\n </ul>\n</div>\n\n<div id=\"teaspoon-controls\" class=\"teaspoon-clearfix\">\n <div id=\"teaspoon-toggles\">\n <button id=\"teaspoon-use-catch\" title=\"Toggle using try/catch wrappers when possible\">Try/Catch</button>\n <button id=\"teaspoon-build-full-report\" title=\"Toggle building the full report\">Full Report</button>\n <button id=\"teaspoon-display-progress\" title=\"Toggle displaying progress as tests run\">Progress</button>\n </div>\n <div id=\"teaspoon-suites\"></div>\n</div>\n\n<hr/>\n\n<div id=\"teaspoon-filter\">\n <h1>Applied Filters [<a href=\"" + window.location.pathname + "\" id=\"teaspoon-filter-clear\">remove</a>]</h1>\n <ul id=\"teaspoon-filter-list\"></ul>\n</div>\n\n<div id=\"teaspoon-report\">\n <ol id=\"teaspoon-report-failures\"></ol>\n <ol id=\"teaspoon-report-all\"></ol>\n</div>";
1003
- };
1004
-
1005
- }).call(this);
1006
- (function() {
1007
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
1008
-
1009
- Teaspoon.Reporters.Console = (function() {
1010
- function Console() {
1011
- this.reportRunnerResults = __bind(this.reportRunnerResults, this);
1012
- this.start = new Teaspoon.Date();
1013
- this.suites = {};
1014
- }
1015
-
1016
- Console.prototype.reportRunnerStarting = function(runner) {
1017
- return this.log({
1018
- type: "runner",
1019
- total: runner.total || (typeof runner.specs === "function" ? runner.specs().length : void 0) || 0,
1020
- start: JSON.parse(JSON.stringify(this.start))
1021
- });
1022
- };
1023
-
1024
- 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];
1030
- if (this.suites[suite.fullDescription]) {
1031
- continue;
1032
- }
1033
- this.suites[suite.fullDescription] = true;
1034
- _results.push(this.log({
1035
- type: "suite",
1036
- label: suite.description,
1037
- level: index
1038
- }));
1039
- }
1040
- return _results;
1041
- };
1042
-
1043
- Console.prototype.reportSpecResults = function(spec) {
1044
- var result;
1045
- this.spec = new Teaspoon.Spec(spec);
1046
- result = this.spec.result();
1047
- if (result.skipped) {
1048
- return;
1049
- }
1050
- this.reportSuites();
1051
- switch (result.status) {
1052
- case "pending":
1053
- return this.trackPending();
1054
- case "failed":
1055
- return this.trackFailure();
1056
- default:
1057
- return this.log({
1058
- type: "spec",
1059
- suite: this.spec.suiteName,
1060
- label: this.spec.description,
1061
- status: result.status,
1062
- skipped: result.skipped
1063
- });
1064
- }
1065
- };
1066
-
1067
- Console.prototype.trackPending = function() {
1068
- var result;
1069
- result = this.spec.result();
1070
- return this.log({
1071
- type: "spec",
1072
- suite: this.spec.suiteName,
1073
- label: this.spec.description,
1074
- status: result.status,
1075
- skipped: result.skipped
1076
- });
1077
- };
1078
-
1079
- Console.prototype.trackFailure = function() {
1080
- var error, result, _i, _len, _ref, _results;
1081
- 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({
1087
- type: "spec",
1088
- suite: this.spec.suiteName,
1089
- label: this.spec.description,
1090
- status: result.status,
1091
- skipped: result.skipped,
1092
- link: this.spec.fullDescription,
1093
- message: error.message,
1094
- trace: error.stack || error.message || "Stack Trace Unavailable"
1095
- }));
1096
- }
1097
- return _results;
1098
- };
1099
-
1100
- Console.prototype.reportRunnerResults = function() {
1101
- this.log({
1102
- type: "result",
1103
- elapsed: ((new Teaspoon.Date().getTime() - this.start.getTime()) / 1000).toFixed(5),
1104
- coverage: window.__coverage__
1105
- });
1106
- return Teaspoon.finished = true;
1107
- };
1108
-
1109
- Console.prototype.log = function(obj) {
1110
- if (obj == null) {
1111
- obj = {};
1112
- }
1113
- obj["_teaspoon"] = true;
1114
- return Teaspoon.log(JSON.stringify(obj));
1115
- };
1116
-
1117
- return Console;
1118
-
1119
- })();
1120
-
1121
- }).call(this);
1122
- (function() {
1123
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
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; };
1126
-
1127
- Teaspoon.Reporters.Console = (function(_super) {
1128
- __extends(Console, _super);
1129
-
1130
- function Console() {
1131
- this.bindScenarioOutput = __bind(this.bindScenarioOutput, this);
1132
- Console.__super__.constructor.apply(this, arguments);
1133
- angular.scenario.output("teaspoon", this.bindScenarioOutput);
1134
- }
1135
-
1136
- Console.prototype.bindScenarioOutput = function(context, runner, model) {
1137
- var _this = this;
1138
- model.on("runnerBegin", function() {
1139
- return _this.reportRunnerStarting({
1140
- total: angular.scenario.Describe.specId
1141
- });
1142
- });
1143
- model.on("specEnd", function(spec) {
1144
- return _this.reportSpecResults(spec);
1145
- });
1146
- return model.on("runnerEnd", function() {
1147
- return _this.reportRunnerResults();
1148
- });
1149
- };
1150
-
1151
- return Console;
1152
-
1153
- })(Teaspoon.Reporters.Console);
1154
-
1155
- }).call(this);
1156
- (function() {
1157
- var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
1158
- __hasProp = {}.hasOwnProperty,
1159
- __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; };
1160
-
1161
- Teaspoon.Reporters.HTML = (function(_super) {
1162
- __extends(HTML, _super);
1163
-
1164
- function HTML() {
1165
- this.bindScenarioOutput = __bind(this.bindScenarioOutput, this);
1166
- HTML.__super__.constructor.apply(this, arguments);
1167
- angular.scenario.output("teaspoon", this.bindScenarioOutput);
1168
- }
1169
-
1170
- HTML.prototype.bindScenarioOutput = function(context, runner, model) {
1171
- var _this = this;
1172
- model.on("specEnd", function(spec) {
1173
- return _this.reportSpecResults(spec);
1174
- });
1175
- model.on("runnerEnd", function() {
1176
- return _this.reportRunnerResults();
1177
- });
1178
- return model.on("runnerBegin", function() {
1179
- var header, specs;
1180
- _this.reportRunnerStarting({
1181
- total: angular.scenario.Describe.specId
1182
- });
1183
- header = document.getElementById("header");
1184
- if (header) {
1185
- header.parentNode.removeChild(header);
1186
- }
1187
- specs = document.getElementById("specs");
1188
- if (specs) {
1189
- return specs.style.paddingTop = 0;
1190
- }
1191
- });
1192
- };
1193
-
1194
- HTML.prototype.envInfo = function() {
1195
- return "angular-scenario 1.0.5";
1196
- };
1197
-
1198
- return HTML;
1199
-
1200
- })(Teaspoon.Reporters.HTML);
1201
-
1202
- }).call(this);
1203
- (function() {
1204
- var _ref,
1205
- __hasProp = {}.hasOwnProperty,
1206
- __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; };
1207
-
1208
- if (!(typeof angular !== "undefined" && angular !== null ? angular.scenario : void 0)) {
1209
- throw new Teaspoon.Error('Angular Scenario not found -- use `suite.use_framework :angular` and adjust or remove the `suite.javascripts` directive.');
1210
- }
1211
-
1212
- Teaspoon.Runner = (function(_super) {
1213
- __extends(Runner, _super);
1214
-
1215
- function Runner() {
1216
- _ref = Runner.__super__.constructor.apply(this, arguments);
1217
- return _ref;
1218
- }
1219
-
1220
- Runner.prototype.setup = function() {
1221
- new (this.getReporter())(this);
1222
- return angular.scenario.setUpAndRun({
1223
- scenario_output: "teaspoon,html"
1224
- });
1225
- };
1226
-
1227
- return Runner;
1228
-
1229
- })(Teaspoon.Runner);
1230
-
1231
- Teaspoon.Spec = (function() {
1232
- function Spec(spec) {
1233
- this.spec = spec;
1234
- this.fullDescription = "" + this.spec.fullDefinitionName + ": " + this.spec.name;
1235
- this.description = this.spec.name;
1236
- this.link = "#";
1237
- this.parent = new Teaspoon.Suite(this.spec);
1238
- this.suiteName = this.parent.fullDescription;
1239
- this.viewId = this.spec.id;
1240
- this.pending = false;
1241
- }
1242
-
1243
- Spec.prototype.getParents = function() {
1244
- return [this.parent];
1245
- };
1246
-
1247
- Spec.prototype.errors = function() {
1248
- var step, _i, _len, _ref1, _results;
1249
- if (!this.spec.steps) {
1250
- return [];
1251
- }
1252
- _ref1 = this.spec.steps;
1253
- _results = [];
1254
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
1255
- step = _ref1[_i];
1256
- if (step.status === "success") {
1257
- continue;
1258
- }
1259
- _results.push({
1260
- message: step.error,
1261
- stack: [step.line]
1262
- });
1263
- }
1264
- return _results;
1265
- };
1266
-
1267
- Spec.prototype.result = function() {
1268
- var status;
1269
- status = "failed";
1270
- if (this.spec.status === "success") {
1271
- status = "passed";
1272
- }
1273
- return {
1274
- status: status,
1275
- skipped: false
1276
- };
1277
- };
1278
-
1279
- return Spec;
1280
-
1281
- })();
1282
-
1283
- Teaspoon.Suite = (function() {
1284
- function Suite(suite) {
1285
- this.suite = suite;
1286
- this.fullDescription = this.suite.fullDefinitionName;
1287
- this.description = this.suite.fullDefinitionName;
1288
- this.link = "#";
1289
- this.parent = {
1290
- root: true
1291
- };
1292
- this.viewId = null;
1293
- }
1294
-
1295
- return Suite;
1296
-
1297
- })();
1298
-
1299
- }).call(this);