teaspoon 0.9.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +141 -0
  3. data/README.md +9 -19
  4. data/{vendor → app}/assets/javascripts/support/bind-poly.js +0 -0
  5. data/{vendor → app}/assets/javascripts/support/sinon.js +0 -0
  6. data/app/assets/javascripts/teaspoon-filterer.js +55 -0
  7. data/app/assets/javascripts/teaspoon/error.coffee +5 -0
  8. data/app/assets/javascripts/teaspoon/{base/fixture.coffee → fixture.coffee} +15 -15
  9. data/app/assets/javascripts/teaspoon/{base/hook.coffee → hook.coffee} +0 -0
  10. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/console.coffee +18 -10
  11. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html.coffee +43 -40
  12. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/base_view.coffee +0 -0
  13. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/failure_view.coffee +2 -0
  14. data/app/assets/javascripts/teaspoon/reporters/html/progress_view.coffee +18 -0
  15. data/app/assets/javascripts/teaspoon/{base/reporters/html/progress_view.coffee → reporters/html/radial_progress_view.coffee} +1 -34
  16. data/app/assets/javascripts/teaspoon/reporters/html/simple_progress_view.coffee +15 -0
  17. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/spec_view.coffee +5 -3
  18. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/suite_view.coffee +4 -2
  19. data/app/assets/javascripts/teaspoon/{base/reporters → reporters}/html/template.coffee +0 -0
  20. data/app/assets/javascripts/teaspoon/{base/runner.coffee → runner.coffee} +7 -3
  21. data/app/assets/javascripts/teaspoon/teaspoon.coffee +90 -32
  22. data/app/controllers/teaspoon/suite_controller.rb +5 -0
  23. data/app/views/teaspoon/suite/index.html.erb +1 -1
  24. data/lib/generators/teaspoon/install/install_generator.rb +67 -37
  25. data/lib/generators/teaspoon/install/templates/MISSING_FRAMEWORK +14 -0
  26. data/lib/generators/teaspoon/install/{POST_INSTALL → templates/POST_INSTALL} +0 -0
  27. data/lib/generators/teaspoon/install/templates/env.rb.tt +14 -0
  28. data/lib/generators/teaspoon/install/templates/{jasmine/env_comments.rb.tt → env_comments.rb.tt} +34 -43
  29. data/lib/tasks/teaspoon/info.rake +17 -0
  30. data/lib/teaspoon-devkit.rb +61 -0
  31. data/lib/teaspoon.rb +2 -0
  32. data/lib/teaspoon/command_line.rb +19 -14
  33. data/lib/teaspoon/configuration.rb +24 -35
  34. data/lib/teaspoon/console.rb +11 -21
  35. data/lib/teaspoon/coverage.rb +14 -7
  36. data/lib/teaspoon/deprecated.rb +22 -4
  37. data/lib/teaspoon/driver.rb +15 -0
  38. data/lib/teaspoon/driver/base.rb +7 -0
  39. data/lib/teaspoon/{drivers/capybara_webkit_driver.rb → driver/capybara_webkit.rb} +8 -5
  40. data/lib/teaspoon/{drivers/phantomjs_driver.rb → driver/phantomjs.rb} +8 -4
  41. data/lib/teaspoon/{drivers → driver}/phantomjs/runner.js +0 -0
  42. data/lib/teaspoon/{drivers/selenium_driver.rb → driver/selenium.rb} +11 -9
  43. data/lib/teaspoon/engine.rb +38 -25
  44. data/lib/teaspoon/environment.rb +24 -15
  45. data/lib/teaspoon/exceptions.rb +154 -41
  46. data/lib/teaspoon/exporter.rb +2 -2
  47. data/lib/teaspoon/formatter.rb +30 -0
  48. data/lib/teaspoon/{formatters → formatter}/base.rb +2 -36
  49. data/lib/teaspoon/{formatters/clean_formatter.rb → formatter/clean.rb} +4 -2
  50. data/lib/teaspoon/{formatters/documentation_formatter.rb → formatter/documentation.rb} +4 -3
  51. data/lib/teaspoon/{formatters/dot_formatter.rb → formatter/dot.rb} +4 -3
  52. data/lib/teaspoon/{formatters/json_formatter.rb → formatter/json.rb} +4 -2
  53. data/lib/teaspoon/{formatters/junit_formatter.rb → formatter/junit.rb} +3 -2
  54. data/lib/teaspoon/{formatters → formatter}/modules/report_module.rb +1 -1
  55. data/lib/teaspoon/{formatters/pride_formatter.rb → formatter/pride.rb} +4 -2
  56. data/lib/teaspoon/{formatters/rspec_html_formatter.rb → formatter/rspec_html.rb} +3 -2
  57. data/lib/teaspoon/{formatters/snowday_formatter.rb → formatter/snowday.rb} +3 -2
  58. data/lib/teaspoon/formatter/swayze_or_oprah.rb +111 -0
  59. data/lib/teaspoon/{formatters/tap_formatter.rb → formatter/tap.rb} +4 -2
  60. data/lib/teaspoon/{formatters/tap_y_formatter.rb → formatter/tap_y.rb} +3 -2
  61. data/lib/teaspoon/{formatters/teamcity_formatter.rb → formatter/teamcity.rb} +4 -2
  62. data/lib/teaspoon/framework.rb +17 -0
  63. data/lib/teaspoon/framework/base.rb +88 -0
  64. data/lib/teaspoon/instrumentation.rb +12 -2
  65. data/lib/teaspoon/registry.rb +47 -0
  66. data/lib/teaspoon/registry/has_default.rb +11 -0
  67. data/lib/teaspoon/runner.rb +6 -7
  68. data/lib/teaspoon/server.rb +2 -2
  69. data/lib/teaspoon/suite.rb +28 -30
  70. data/lib/teaspoon/utility.rb +5 -0
  71. data/lib/teaspoon/version.rb +1 -1
  72. metadata +52 -276
  73. data/app/assets/javascripts/teaspoon-jasmine.js +0 -1344
  74. data/app/assets/javascripts/teaspoon-mocha.js +0 -1350
  75. data/app/assets/javascripts/teaspoon-qunit.js +0 -1415
  76. data/app/assets/javascripts/teaspoon-teaspoon.js +0 -51
  77. data/app/assets/javascripts/teaspoon/base/teaspoon.coffee +0 -69
  78. data/app/assets/javascripts/teaspoon/jasmine.coffee +0 -119
  79. data/app/assets/javascripts/teaspoon/jasmine/reporters/html.coffee +0 -11
  80. data/app/assets/javascripts/teaspoon/mocha.coffee +0 -90
  81. data/app/assets/javascripts/teaspoon/mocha/reporters/console.coffee +0 -16
  82. data/app/assets/javascripts/teaspoon/mocha/reporters/html.coffee +0 -27
  83. data/app/assets/javascripts/teaspoon/qunit.coffee +0 -81
  84. data/app/assets/javascripts/teaspoon/qunit/reporters/console.coffee +0 -25
  85. data/app/assets/javascripts/teaspoon/qunit/reporters/html.coffee +0 -80
  86. data/lib/generators/teaspoon/install/templates/jasmine/env.rb +0 -11
  87. data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee +0 -31
  88. data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.js +0 -31
  89. data/lib/generators/teaspoon/install/templates/mocha/env.rb +0 -11
  90. data/lib/generators/teaspoon/install/templates/mocha/env_comments.rb.tt +0 -187
  91. data/lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee +0 -40
  92. data/lib/generators/teaspoon/install/templates/mocha/spec_helper.js +0 -40
  93. data/lib/generators/teaspoon/install/templates/qunit/env.rb +0 -11
  94. data/lib/generators/teaspoon/install/templates/qunit/env_comments.rb.tt +0 -187
  95. data/lib/generators/teaspoon/install/templates/qunit/test_helper.coffee +0 -29
  96. data/lib/generators/teaspoon/install/templates/qunit/test_helper.js +0 -30
  97. data/lib/teaspoon/drivers/base.rb +0 -10
  98. data/lib/teaspoon/formatters/description.rb +0 -36
  99. data/lib/teaspoon/formatters/swayze_or_oprah_formatter.rb +0 -101
  100. data/spec/dummy/Rakefile +0 -7
  101. data/spec/dummy/app/assets/javascripts/instrumented1.coffee +0 -1
  102. data/spec/dummy/app/assets/javascripts/instrumented2.coffee +0 -1
  103. data/spec/dummy/app/assets/javascripts/integration/integration.coffee +0 -1
  104. data/spec/dummy/app/assets/javascripts/integration/integration_spec.coffee +0 -32
  105. data/spec/dummy/app/assets/javascripts/integration/spec_helper.coffee +0 -7
  106. data/spec/dummy/app/assets/javascripts/specs/asset_spec.js +0 -11
  107. data/spec/dummy/config.ru +0 -15
  108. data/spec/dummy/config/application.rb +0 -29
  109. data/spec/dummy/config/boot.rb +0 -3
  110. data/spec/dummy/config/environment.rb +0 -5
  111. data/spec/dummy/config/environments/development.rb +0 -41
  112. data/spec/dummy/config/environments/production.rb +0 -79
  113. data/spec/dummy/config/environments/test.rb +0 -42
  114. data/spec/dummy/config/routes.rb +0 -2
  115. data/spec/dummy/config/secrets.yml +0 -22
  116. data/spec/dummy/log/.gitkeep +0 -0
  117. data/spec/dummy/public/favicon.ico +0 -0
  118. data/spec/dummy/script/rails +0 -6
  119. data/spec/features/console_reporter_spec.rb +0 -62
  120. data/spec/features/hooks_spec.rb +0 -60
  121. data/spec/features/html_reporter_spec.rb +0 -81
  122. data/spec/features/install_generator_spec.rb +0 -54
  123. data/spec/features/instrumentation_spec.rb +0 -21
  124. data/spec/fixtures/coverage.json +0 -243
  125. data/spec/javascripts/fixtures/_body.html.erb +0 -1
  126. data/spec/javascripts/fixtures/fixture.html.haml +0 -4
  127. data/spec/javascripts/fixtures/fixture.json +0 -4
  128. data/spec/javascripts/jasmine_helper.coffee +0 -3
  129. data/spec/javascripts/mocha_helper.coffee +0 -4
  130. data/spec/javascripts/spec_helper.coffee +0 -7
  131. data/spec/javascripts/stylesheets/stylesheet.css.scss +0 -0
  132. data/spec/javascripts/support/json2.js +0 -486
  133. data/spec/javascripts/support/support.js.coffee +0 -0
  134. data/spec/javascripts/teaspoon/base/fixture_spec.coffee +0 -93
  135. data/spec/javascripts/teaspoon/base/reporters/console_spec.coffee +0 -162
  136. data/spec/javascripts/teaspoon/base/reporters/html/base_view_spec.coffee +0 -88
  137. data/spec/javascripts/teaspoon/base/reporters/html/failure_view_spec.coffee +0 -28
  138. data/spec/javascripts/teaspoon/base/reporters/html/progress_view_spec.coffee +0 -1
  139. data/spec/javascripts/teaspoon/base/reporters/html/spec_view_spec.coffee +0 -1
  140. data/spec/javascripts/teaspoon/base/reporters/html/suite_view_spec.coffee +0 -1
  141. data/spec/javascripts/teaspoon/base/reporters/html_spec.coffee +0 -372
  142. data/spec/javascripts/teaspoon/base/runner_spec.coffee +0 -58
  143. data/spec/javascripts/teaspoon/base/teaspoon_spec.coffee +0 -47
  144. data/spec/javascripts/teaspoon/jasmine/fixture_jspec.coffee +0 -13
  145. data/spec/javascripts/teaspoon/jasmine/models_jspec.coffee +0 -101
  146. data/spec/javascripts/teaspoon/jasmine/reporters/html_jspec.coffee +0 -17
  147. data/spec/javascripts/teaspoon/jasmine/runner_jspec.coffee +0 -59
  148. data/spec/javascripts/teaspoon/jasmine/spec_jspec.coffee +0 -3
  149. data/spec/javascripts/teaspoon/mocha/fixture_mspec.coffee +0 -12
  150. data/spec/javascripts/teaspoon/mocha/models_mspec.coffee +0 -93
  151. data/spec/javascripts/teaspoon/mocha/reporters/console_mspec.coffee +0 -24
  152. data/spec/javascripts/teaspoon/mocha/reporters/html_mspec.coffee +0 -41
  153. data/spec/javascripts/teaspoon/mocha/runner_mspec.coffee +0 -23
  154. data/spec/javascripts/teaspoon/mocha/spec_mspec.coffee +0 -9
  155. data/spec/javascripts/teaspoon/other/erb_spec.js.coffee.erb +0 -4
  156. data/spec/javascripts/teaspoon/phantomjs/runner_spec.coffee +0 -161
  157. data/spec/javascripts/turbolinks_helper.coffee +0 -2
  158. data/spec/spec_helper.rb +0 -25
  159. data/spec/support/aruba.rb +0 -15
  160. data/spec/teaspoon/command_line_spec.rb +0 -157
  161. data/spec/teaspoon/configuration_spec.rb +0 -236
  162. data/spec/teaspoon/console_spec.rb +0 -224
  163. data/spec/teaspoon/coverage_spec.rb +0 -118
  164. data/spec/teaspoon/drivers/base_spec.rb +0 -5
  165. data/spec/teaspoon/drivers/capybara_webkit_driver_spec.rb +0 -39
  166. data/spec/teaspoon/drivers/phantomjs_driver_spec.rb +0 -66
  167. data/spec/teaspoon/drivers/selenium_driver_spec.rb +0 -68
  168. data/spec/teaspoon/engine_spec.rb +0 -22
  169. data/spec/teaspoon/environment_spec.rb +0 -109
  170. data/spec/teaspoon/exceptions_spec.rb +0 -57
  171. data/spec/teaspoon/exporter_spec.rb +0 -96
  172. data/spec/teaspoon/formatters/base_spec.rb +0 -259
  173. data/spec/teaspoon/formatters/clean_formatter_spec.rb +0 -37
  174. data/spec/teaspoon/formatters/documentation_formatter_spec.rb +0 -127
  175. data/spec/teaspoon/formatters/dot_formatter_spec.rb +0 -116
  176. data/spec/teaspoon/formatters/json_formatter_spec.rb +0 -77
  177. data/spec/teaspoon/formatters/junit_formatter_spec.rb +0 -114
  178. data/spec/teaspoon/formatters/pride_formatter_spec.rb +0 -37
  179. data/spec/teaspoon/formatters/rspec_html_formatter_spec.rb +0 -107
  180. data/spec/teaspoon/formatters/snowday_formatter_spec.rb +0 -35
  181. data/spec/teaspoon/formatters/tap_formatter_spec.rb +0 -72
  182. data/spec/teaspoon/formatters/tap_y_formatter_spec.rb +0 -80
  183. data/spec/teaspoon/formatters/teamcity_formatter_spec.rb +0 -148
  184. data/spec/teaspoon/instrumentation_spec.rb +0 -113
  185. data/spec/teaspoon/result_spec.rb +0 -98
  186. data/spec/teaspoon/runner_spec.rb +0 -116
  187. data/spec/teaspoon/server_spec.rb +0 -105
  188. data/spec/teaspoon/suite_spec.rb +0 -138
  189. data/spec/teaspoon_env.rb +0 -39
  190. data/test/javascripts/qunit_helper.coffee +0 -3
  191. data/test/javascripts/teaspoon/qunit/fixture_test.coffee +0 -10
  192. data/test/javascripts/teaspoon/qunit/models_test.coffee +0 -66
  193. data/test/javascripts/teaspoon/qunit/reporters/console_test.coffee +0 -3
  194. data/test/javascripts/teaspoon/qunit/reporters/html/failure_view_test.coffee +0 -3
  195. data/test/javascripts/teaspoon/qunit/reporters/html/spec_view_test.coffee +0 -3
  196. data/test/javascripts/teaspoon/qunit/reporters/html/suite_view_test.coffee +0 -3
  197. data/test/javascripts/teaspoon/qunit/reporters/html_test.coffee +0 -3
  198. data/test/javascripts/teaspoon/qunit/runner_test.coffee +0 -18
  199. data/vendor/assets/javascripts/jasmine/1.3.1.js +0 -2602
  200. data/vendor/assets/javascripts/jasmine/2.0.0.js +0 -2412
  201. data/vendor/assets/javascripts/jasmine/MIT.LICENSE +0 -20
  202. data/vendor/assets/javascripts/mocha/1.10.0.js +0 -5374
  203. data/vendor/assets/javascripts/mocha/1.17.1.js +0 -5813
  204. data/vendor/assets/javascripts/mocha/MIT.LICENSE +0 -22
  205. data/vendor/assets/javascripts/qunit/1.12.0.js +0 -2212
  206. data/vendor/assets/javascripts/qunit/1.14.0.js +0 -2288
  207. data/vendor/assets/javascripts/qunit/MIT.LICENSE +0 -21
  208. data/vendor/assets/javascripts/support/chai-1.10.0.js +0 -4800
  209. data/vendor/assets/javascripts/support/chai-jq-0.0.7.js +0 -524
  210. data/vendor/assets/javascripts/support/chai.js +0 -4782
  211. data/vendor/assets/javascripts/support/expect.js +0 -1284
  212. data/vendor/assets/javascripts/support/jasmine-jquery-1.7.0.js +0 -720
  213. data/vendor/assets/javascripts/support/jasmine-jquery-2.0.0.js +0 -812
  214. data/vendor/assets/javascripts/support/sinon-chai.js +0 -126
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 727bdb9217114560c7755d33ed032e6c05355a7f
4
- data.tar.gz: b9cdd9f870082cebd6dd8cd3db297a3a425a8620
3
+ metadata.gz: c553b99135614e7bb23eed05345ed59212f039e3
4
+ data.tar.gz: 6ba9d3c79c72c60db28085f782b43be8e3886cfa
5
5
  SHA512:
6
- metadata.gz: 8c7403b545340d18c0290390108fa541d65079f7bc7c955f9816ba10d51aa07f57082754adfc36e63a81f1a5347e1b4081a4de9c4596cc0e844e868ccaa58dd9
7
- data.tar.gz: 622b7ecb4873067b55e25ebbe2647c61bc6070a50e63c17db2674704e39ffe64b1173a7eefbcf76dfbe619dfd2c79b816a1b1dae7dff30ca50bc494cea6681d7
6
+ metadata.gz: 516511f761bb5a5b9348d7cd94d73c427dc8bbf59172ebbc8bcdf5129f1c43940e049982d8279b81f2afe88eb146e8895f054135c1dacc2e94d6235bd6a44b3b
7
+ data.tar.gz: 1e9dc21951bcc43c34b2a144950f3cdde30b05be200583b792697520adb1307481e5d628f1b0d5a76bcb0c2680f2730102d19adaabd7f31e6c0c8116a9d4155f
data/CHANGELOG.md ADDED
@@ -0,0 +1,141 @@
1
+ ### 1.0.0 (unreleased)
2
+
3
+ #### Upgrade Steps
4
+
5
+ - **Update your Gemfile**<br>
6
+ Change your Gemfile to use "teaspoon-framework" instead of "teaspoon".<br>
7
+ eg: If you are using Mocha, this would be `gem 'teaspoon-mocha'`
8
+
9
+ If you had Teaspoon locked at a specific version, kill the version. You'll now need to reference the version of the framework, instead of the version of Teaspoon.<br>
10
+ eg: If your Gemfile has `gem 'teaspoon', '0.9.1'` and you're using Mocha, you'll want your Gemfile to reference the latest version of Mocha: `gem 'teaspoon-mocha', '2.2.4'`. The teaspoon-mocha gem contains previous versions of Mocha, so even if you're not using version 2.2.4 of Mocha in your `teaspoon_env.rb`, still reference the latest version in your Gemfile and the older version should still work.
11
+
12
+ - **Update your coverage configuration in teaspoon_env.rb**<br>
13
+ If you use Teaspoon to generate coverage reports with Istanbul, and you use the `suite.no_coverage` to exclude files from coverage, you'll need to migrate that configuration into the `config.coverage` blocks. So if you have:
14
+
15
+ ```ruby
16
+ suite.no_coverage += /my_file.js/
17
+ ```
18
+
19
+ You should move this into the `coverage` block:
20
+
21
+ ```ruby
22
+ config.coverage do |coverage|
23
+ coverage.ignore += /my_file.js/
24
+ end
25
+ ```
26
+
27
+ This means that you can no longer exclude things at the suite level. If you had multiple suites with different `no_coverage` configurations, you'll now need to create multiple coverage blocks and specify the coverage you want when using the CLI.
28
+ eg: teaspoon --coverage=[coverage_name]
29
+
30
+ - **Ensure suite.javascripts and suite.stylesheets are appending asset**<br>
31
+ If you use `suite.javascripts` or `suite.stylesheets`, make sure you're appending assets into the array instead of assigning the array.
32
+
33
+ eg: In Teaspoon 0.9.1, you might have:
34
+
35
+ ```ruby
36
+ suite.javascripts = ["jasmine/1.3.1", "teaspoon-jasmine", "custom-js-file"]
37
+ ```
38
+
39
+ This will fail as "jasmine/1.3.1" and "teaspoon-jasmine" no longer exist. Teaspoon will automatically add the framework assets to the array for you, so you should append assets instead:
40
+
41
+ ```ruby
42
+ suite.javascripts += ["custom-js-file"]
43
+ ```
44
+
45
+ Likewise for `suite.stylesheets`.
46
+
47
+ #### Enhancements
48
+
49
+ * Break frameworks out into individual gems (eg teaspoon-mocha)
50
+ * Frameworks (eg mocha, jasmine) can now be registered with core
51
+ * Formatters (eg dot, documentation) can now be registered with core
52
+ * Drivers (eg phantomjs, selenium) can now be registered with core
53
+ * Support for Jasmine 2.0
54
+ * Support for Mocha 2.0
55
+ * Improved abstractions around how framework events are handled (via responders)
56
+ * Can now specify framework version when installing
57
+ * Adds `rake teaspoon:info` to show Teaspoon and framework versions
58
+ * Backfill support for old versions of frameworks
59
+ * Fail faster when teaspoon_env.rb cannot be found
60
+ * Lots of refactors to clean things up
61
+
62
+ #### Bug Fixes
63
+
64
+ * Fix files excluded from coverage for RequireJS (@davestevens)
65
+ * Fix double teaspoon hook (#332)
66
+ * Instrument files when config.expand_assets is false (#357)
67
+
68
+
69
+ ### 0.9.1 (3/2/15)
70
+
71
+ * Fixes an issue where suite view was failing
72
+ * CI/Linux stability improvement (alphanumeric ordering of spec files)
73
+
74
+
75
+ ### 0.9.0 (2/24/15)
76
+
77
+ #### Enhancements
78
+
79
+ * Add `expand_assets` suite configuration to control spec compilation
80
+ * Provide QUnit tests with a default `equal` message
81
+ * Support cli reusing running Rails server
82
+ * Add support for Capybara Webkit
83
+ * Better support for RequireJS
84
+ * Add RSpec HTML formatter
85
+
86
+ #### Bug Fixes
87
+
88
+ * Fix qunit 1.14.0 precompile path
89
+
90
+ #### Removals
91
+
92
+ * Direct support for Angular
93
+
94
+
95
+ ### 0.8.0 (4/18/14)
96
+
97
+ Configuration has changed considerably, and deprecation warnings have been provided. In general it's probably best to remove your /initializers/teaspoon.rb and reinstall using the generator. Configuration is now consolidated into spec/teaspoon_env.rb. **This can cause a stack level too deep exception unless the teaspoon_env.rb file properly wraps the loading of rails in a `defined?(Rails)` check.**
98
+
99
+ #### Upgrade Steps
100
+
101
+ 1. backup your `spec/teaspoon_env.rb` file.
102
+ 2. run the install generator to get the new `teaspoon_env.rb`.
103
+ 3. migrate your old settings into the new file, noting the changes that might exist.
104
+ 4. move all settings that you had in `config/initializers/teaspoon.rb` into `spec/teaspoon_env.rb` and delete the initializer.
105
+
106
+ #### Coverage reports
107
+
108
+ Coverage has changed in terms of configuration, to allow for different coverage configurations, and they behave a lot like suite configurations now. You can have any number of coverage configurations and can specify which coverage configuration to use from the command line.
109
+
110
+ ```ruby
111
+ config.coverage do |coverage|
112
+ coverage.reports = ["text"]
113
+ end
114
+ config.coverage :CI do |coverage|
115
+ coverage.reports = ["cobertura", "lcov"]
116
+ end
117
+ config.use_coverage = :CI
118
+ ```
119
+
120
+ #### Frameworks
121
+
122
+ The configuration around which test framework is used for a suite has been changed and improved. Instead of configuring via the `javascripts` directive we're transitioning to a more complete structure with `use_framework`.
123
+
124
+ You can specify version of test framework with `use_framework` now, which allows for the gem to be updated, while keeping the impact on your specs minimal.
125
+
126
+ ```ruby
127
+ suite.use_framework :mocha, "1.10.0"
128
+ ```
129
+
130
+ #### Formatters
131
+
132
+ Running CI with two formatters is easier, as formatters can be sent to file output instead of just $stdout by using > in the formatter name to be used. Just remember to wrap it in a string when you specify it in the CLI -- or all output will be piped to that file.
133
+
134
+ ```
135
+ teaspoon --format="dots,junit>/path/to/junit_output.xml"
136
+ config.formatters = ["dots", "junit>/path/to/junit_output.xml"]
137
+ ```
138
+
139
+ #### Drivers
140
+
141
+ Drivers have a more feature complete configuration strategy. For PhantomJS you can provide a string of flags (eg. --debug=true), and the selenium driver can accept a hash (or json string) to specify something other than firefox for instance.
data/README.md CHANGED
@@ -51,33 +51,22 @@ If you'd like to use Teaspoon with [Guard](https://github.com/guard/guard), chec
51
51
 
52
52
  ## Installation
53
53
 
54
- Add it to your Gemfile. In most cases you'll want to restrict it to the `:development, :test` groups.
54
+ Add the framework-specific Teaspoon gem to your Gemfile. In most cases you'll want to restrict it to the `:development, :test` groups. The available gems are `teaspoon-jasmine`, `teaspoon-mocha` and `teaspoon-qunit`. If you're unsure which framework you'd like to use, we think Jasmine is a good starting place.
55
55
 
56
56
  ```ruby
57
57
  group :development, :test do
58
- gem "teaspoon"
58
+ gem "teaspoon-jasmine"
59
59
  end
60
60
  ```
61
61
 
62
- Run the install generator to get the environment file and a basic spec helper. You can tell the generator which framework you want to use, or if you want a CoffeeScript spec helper. Run the install generator with the `--help` flag for a list of available options.
62
+ Run the install generator to get the environment file and a basic spec helper. If you want a CoffeeScript spec helper, you can tell the generator. Run the install generator with the `--help` flag for a list of available options.
63
63
 
64
64
  ```
65
- rails generate teaspoon:install --framework=mocha --coffee
65
+ rails generate teaspoon:install --coffee
66
66
  ```
67
67
 
68
68
  To run Teaspoon headless you'll need PhantomJS, Selenium Webdriver or Capybara Webkit. We recommend PhantomJS, which you can install with homebrew, npm or [as a download](http://phantomjs.org/download.html).
69
69
 
70
- ### Upgrading
71
-
72
- As of version 0.8.0 there are some changes to how configuration and loading works, which might cause some confusion. For this we're sorry, but it'll be better in the long run. While we know that considerable changes like these can be a pain, they're not made frivolously, and they set the groundwork for what we can all build on and contribute to. We appreciate your tolerance and willingness to help us fix anything that we missed.
73
-
74
- :heart:
75
-
76
- 1. backup your `spec/teaspoon_env.rb` file.
77
- 2. run the install generator to get the new `teaspoon_env.rb`.
78
- 3. migrate your old settings into the new file, noting the changes that might exist.
79
- 4. move all settings that you had in `config/initializers/teaspoon.rb` into `spec/teaspoon_env.rb` and delete the initializer.
80
-
81
70
 
82
71
  ## Usage
83
72
 
@@ -134,7 +123,7 @@ bundle exec teaspoon --help
134
123
 
135
124
  Depending on which framework you use this can differ, and there's an expectation that you have a certain level of familiarity with your chosen test framework.
136
125
 
137
- Teaspoon supports [Jasmine 1.3](http://pivotal.github.com/jasmine), [Mocha](https://github.com/mochajs/mocha) and [QUnit](http://qunitjs.com). And since it's possible to use the asset pipeline, feel free to use the `= require` directive throughout your specs and spec helpers.
126
+ Teaspoon supports [Jasmine](http://pivotal.github.com/jasmine), [Mocha](https://github.com/mochajs/mocha) and [QUnit](http://qunitjs.com). And since it's possible to use the asset pipeline, feel free to use the `= require` directive throughout your specs and spec helpers.
138
127
 
139
128
  Here's a basic spec written in Javascript using Jasmine:
140
129
 
@@ -300,7 +289,6 @@ end
300
289
  ```
301
290
 
302
291
  Once hooks have been defined in your configuration, you can invoke them using the javascript `Teaspoon.hook` interface in your specs. A request will be sent to the server, where all blocks that have been specified for a given hook will be called in the order they were defined. Any arguments passed to `Teaspoon.hook` will be provided to the hooks defined in the configuration.
303
- ```
304
292
 
305
293
  ```js
306
294
  Teaspoon.hook('fixtures')
@@ -366,12 +354,14 @@ When you install Teaspoon a `teaspoon_env.rb` file is generated that contains go
366
354
 
367
355
  ## Test Frameworks
368
356
 
369
- [Jasmine](http://pivotal.github.com/jasmine) is used by default unless you specify otherwise. We've been using Jasmine for a long time, and have been pretty happy with it. It lacks a few important things that could be in a test framework, so we've done a little bit of work to make that nicer. Like adding pending spec support.
357
+ [Jasmine](http://pivotal.github.com/jasmine) is one of the first BDD-style frameworks. We've been using Jasmine for a long time, and have been pretty happy with it. It lacks a few important things that could be in a test framework, so we've done a little bit of work to make that nicer. Like adding pending spec support.
370
358
 
371
359
  [Mocha](http://visionmedia.github.com/mocha) came up while we were working on Teaspoon -- we read up about it and thought it was a pretty awesome library with some really great approaches to some of the things that some of us browser types should consider more often, so we included it and added support for it. We encourage you to give it a try. Read more about [Using Mocha](https://github.com/modeset/teaspoon/wiki/Using-Mocha) with Teaspoon.
372
360
 
373
361
  [QUnit](http://qunitjs.com) We're not sure about how many people use QUnit, but we like jQuery, so we added it. Read more about [Using QUnit](https://github.com/modeset/teaspoon/wiki/Using-QUnit) with Teaspoon.
374
362
 
363
+ If you'd like to see what frameworks and versions Teaspoon supports, you can run `rake teaspoon:info`. The results of this will be restricted by what framework gems you have included in your Gemfile.
364
+
375
365
 
376
366
  ## Support Libraries
377
367
 
@@ -435,7 +425,7 @@ Licensed under the [MIT License](http://creativecommons.org/licenses/MIT/)
435
425
 
436
426
  Copyright 2014 [Mode Set](https://github.com/modeset)
437
427
 
438
- All licenses for the [bundled Javascript libraries](https://github.com/modeset/teaspoon/tree/master/vendor/assets/javascripts) are included (MIT/BSD).
428
+ All licenses for the bundled Javascript libraries are included (MIT/BSD).
439
429
 
440
430
 
441
431
  ## Make Code Not War
File without changes
@@ -0,0 +1,55 @@
1
+ (function() {
2
+ var Teaspoon,
3
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
4
+
5
+ Teaspoon = {};
6
+
7
+ Teaspoon.Filterer = (function() {
8
+ function Filterer() {
9
+ this.filter = __bind(this.filter, this);
10
+ this.files = document.querySelectorAll("#teaspoon-suite-list .file a");
11
+ this.input = document.querySelector("#teaspoon-filter-input");
12
+ this.input.value = "";
13
+ this.input.onkeyup = this.filter;
14
+ }
15
+
16
+ Filterer.prototype.filter = function() {
17
+ var file, _i, _len, _ref, _results;
18
+ _ref = this.files;
19
+ _results = [];
20
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
21
+ file = _ref[_i];
22
+ if (LiquidMetal.score(file.innerHTML, this.input.value) > 0) {
23
+ _results.push(file.parentNode.style.display = "block");
24
+ } else {
25
+ _results.push(file.parentNode.style.display = "none");
26
+ }
27
+ }
28
+ return _results;
29
+ };
30
+
31
+ return Filterer;
32
+
33
+ })();
34
+
35
+ window.onload = function() {
36
+ return new Teaspoon.Filterer();
37
+ };
38
+
39
+
40
+ /*!
41
+ * LiquidMetal
42
+ * Copyright (c) 2009, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org)
43
+ */
44
+ var LiquidMetal=function(){var l=0.0;var m=1.0;var n=0.8;var o=0.9;var p=0.85;return{score:function(a,b){if(b.length==0)
45
+ return n;if(b.length>a.length)return l;var c=this.buildScoreArray(a,b);var d=0.0;for(var i=0;i<c.length;i++){d+=c[i]}
46
+ return(d/c.length)},buildScoreArray:function(a,b){var d=new Array(a.length);var e=a.toLowerCase();
47
+ var f=b.toLowerCase().split("");var g=-1;var h=false;for(var i=0;i<f.length;i++){var c=f[i];var j=e.indexOf(c,g+1);
48
+ if(j<0)return fillArray(d,l);if(j==0)h=true;if(isNewWord(a,j)){d[j-1]=1;fillArray(d,p,g+1,j-1)}else if(isUpperCase(a,j))
49
+ {fillArray(d,p,g+1,j)}else{fillArray(d,l,g+1,j)}d[j]=m;g=j}var k=h?o:n;fillArray(d,k,g+1);return d}};
50
+ function isUpperCase(a,b){var c=a.charAt(b);return("A"<=c&&c<="Z")}function isNewWord(a,b){var c=a.charAt(b-1);
51
+ return(c==" "||c=="\t")}function fillArray(a,b,c,d){c=Math.max(c||0,0);d=Math.min(d||a.length,a.length);
52
+ for(var i=c;i<d;i++){a[i]=b}return a}}();
53
+ ;
54
+
55
+ }).call(this);
@@ -0,0 +1,5 @@
1
+ class Teaspoon.Error extends Error
2
+
3
+ constructor: (message) ->
4
+ @name = "TeaspoonError"
5
+ @message = (message || "")
@@ -1,4 +1,4 @@
1
- class Teaspoon.fixture
1
+ class Teaspoon.Fixture
2
2
 
3
3
  @cache: {}
4
4
  @el: null
@@ -28,7 +28,7 @@ class Teaspoon.fixture
28
28
 
29
29
 
30
30
  # behaves like load, and is only provided as a convenience
31
- constructor: -> Teaspoon.fixture.load.apply(window, arguments)
31
+ constructor: -> window.fixture.load.apply(window, arguments)
32
32
 
33
33
 
34
34
  # Private
@@ -40,7 +40,7 @@ class Teaspoon.fixture
40
40
 
41
41
 
42
42
  load = (url, append, preload = false) =>
43
- return loadComplete(url, cached.type, cached.content, append, preload) if cached = Teaspoon.fixture.cache[url]
43
+ return loadComplete(url, cached.type, cached.content, append, preload) if cached = window.fixture.cache[url]
44
44
  value = null
45
45
  xhrRequest url, ->
46
46
  return unless xhr.readyState == 4
@@ -50,11 +50,11 @@ class Teaspoon.fixture
50
50
 
51
51
 
52
52
  loadComplete = (url, type, content, append, preload) =>
53
- Teaspoon.fixture.cache[url] = {type: type, content: content}
53
+ window.fixture.cache[url] = {type: type, content: content}
54
54
  return @json[@json.push(JSON.parse(content)) - 1] if type.match(/application\/json;/)
55
55
  return content if preload
56
56
  if append then addContent(content) else putContent(content)
57
- return Teaspoon.fixture.el
57
+ return window.fixture.el
58
58
 
59
59
 
60
60
  set = (content, append) ->
@@ -64,25 +64,25 @@ class Teaspoon.fixture
64
64
  putContent = (content) =>
65
65
  cleanup()
66
66
  create()
67
- Teaspoon.fixture.el.innerHTML = content
67
+ window.fixture.el.innerHTML = content
68
68
 
69
69
 
70
70
  addContent = (content) =>
71
- create() unless Teaspoon.fixture.el
72
- Teaspoon.fixture.el.innerHTML += content
71
+ create() unless window.fixture.el
72
+ window.fixture.el.innerHTML += content
73
73
 
74
74
 
75
75
  create = =>
76
- Teaspoon.fixture.el = document.createElement("div")
77
- Teaspoon.fixture.$el = $(Teaspoon.fixture.el) if typeof(window.$) == 'function'
78
- Teaspoon.fixture.el.id = "teaspoon-fixtures"
79
- document.body?.appendChild(Teaspoon.fixture.el)
76
+ window.fixture.el = document.createElement("div")
77
+ window.fixture.$el = $(window.fixture.el) if typeof(window.$) == 'function'
78
+ window.fixture.el.id = "teaspoon-fixtures"
79
+ document.body?.appendChild(window.fixture.el)
80
80
 
81
81
 
82
82
  cleanup = =>
83
- Teaspoon.fixture.el ||= document.getElementById("teaspoon-fixtures")
84
- Teaspoon.fixture.el?.parentNode?.removeChild(Teaspoon.fixture.el)
85
- Teaspoon.fixture.el = null
83
+ window.fixture.el ||= document.getElementById("teaspoon-fixtures")
84
+ window.fixture.el?.parentNode?.removeChild(window.fixture.el)
85
+ window.fixture.el = null
86
86
 
87
87
 
88
88
  xhrRequest = (url, callback) ->
@@ -12,6 +12,23 @@ class Teaspoon.Reporters.Console
12
12
  start: JSON.parse(JSON.stringify(@start))
13
13
 
14
14
 
15
+ reportRunnerResults: =>
16
+ @log
17
+ type: "result"
18
+ elapsed: ((new Teaspoon.Date().getTime() - @start.getTime()) / 1000).toFixed(5)
19
+ coverage: window.__coverage__
20
+ Teaspoon.finished = true
21
+
22
+
23
+ reportSuiteStarting: (suite) -> # noop
24
+
25
+
26
+ reportSuiteResults: (suite) -> # noop
27
+
28
+
29
+ reportSpecStarting: (spec) -> # noop
30
+
31
+
15
32
  reportSuites: ->
16
33
  for suite, index in @spec.getParents()
17
34
  continue if @suites[suite.fullDescription]
@@ -22,8 +39,7 @@ class Teaspoon.Reporters.Console
22
39
  level: index
23
40
 
24
41
 
25
- reportSpecResults: (spec) ->
26
- @spec = new Teaspoon.Spec(spec)
42
+ reportSpecResults: (@spec) ->
27
43
  result = @spec.result()
28
44
  return if result.skipped
29
45
  @reportSuites()
@@ -63,14 +79,6 @@ class Teaspoon.Reporters.Console
63
79
  trace: error.stack || error.message || "Stack Trace Unavailable"
64
80
 
65
81
 
66
- reportRunnerResults: =>
67
- @log
68
- type: "result"
69
- elapsed: ((new Teaspoon.Date().getTime() - @start.getTime()) / 1000).toFixed(5)
70
- coverage: window.__coverage__
71
- Teaspoon.finished = true
72
-
73
-
74
82
  log: (obj = {}) ->
75
83
  obj["_teaspoon"] = true
76
84
  Teaspoon.log(JSON.stringify(obj))
@@ -1,10 +1,6 @@
1
- #= require teaspoon/base/reporters/html/base_view
1
+ #= require teaspoon/reporters/html/base_view
2
2
  #= require_self
3
- #= require teaspoon/base/reporters/html/progress_view
4
- #= require teaspoon/base/reporters/html/spec_view
5
- #= require teaspoon/base/reporters/html/failure_view
6
- #= require teaspoon/base/reporters/html/suite_view
7
- #= require teaspoon/base/reporters/html/template
3
+ #= require_tree ./html
8
4
 
9
5
  class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
10
6
 
@@ -36,10 +32,45 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
36
32
  @buildFilters()
37
33
 
38
34
 
35
+ reportRunnerStarting: (runner) ->
36
+ @total.exist = runner.total || 0
37
+ @setText("stats-duration", "...") if @total.exist
38
+
39
+
40
+ reportRunnerResults: =>
41
+ return unless @total.run
42
+ @setText("stats-duration", @elapsedTime())
43
+ @setStatus("passed") unless @total.failures
44
+ @setText("stats-passes", @total.passes)
45
+ @setText("stats-failures", @total.failures)
46
+ if @total.run < @total.exist
47
+ @total.skipped = @total.exist - @total.run
48
+ @total.run = @total.exist
49
+ @setText("stats-skipped", @total.skipped)
50
+ @updateProgress()
51
+
52
+
53
+ reportSuiteStarting: (suite) -> # noop
54
+
55
+
56
+ reportSuiteResults: (suite) -> # noop
57
+
58
+
59
+ reportSpecStarting: (spec) ->
60
+ @reportView = new (Teaspoon.resolveClass("Reporters.HTML.SpecView"))(spec, @) if @config["build-full-report"]
61
+ @specStart = new Teaspoon.Date().getTime()
62
+
63
+
64
+ reportSpecResults: (spec) ->
65
+ @total.run += 1
66
+ @updateProgress()
67
+ @updateStatus(spec)
68
+
69
+
39
70
  buildLayout: ->
40
71
  el = @createEl("div")
41
72
  el.id = "teaspoon-interface"
42
- el.innerHTML = Teaspoon.Reporters.HTML.template()
73
+ el.innerHTML = (Teaspoon.resolveClass("Reporters.HTML")).template()
43
74
  document.body.appendChild(el)
44
75
 
45
76
 
@@ -65,36 +96,6 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
65
96
  @setHtml("filter-list", "<li>#{@filters.join("</li><li>")}", true)
66
97
 
67
98
 
68
- reportRunnerStarting: (runner) ->
69
- @total.exist = runner.total || runner.specs?().length || 0
70
- @setText("stats-duration", "...") if @total.exist
71
-
72
-
73
- reportSpecStarting: (spec) ->
74
- spec = new Teaspoon.Spec(spec)
75
- @reportView = new Teaspoon.Reporters.HTML.SpecView(spec, @) if @config["build-full-report"]
76
- @specStart = new Teaspoon.Date().getTime()
77
-
78
-
79
- reportSpecResults: (spec) ->
80
- @total.run += 1
81
- @updateProgress()
82
- @updateStatus(spec)
83
-
84
-
85
- reportRunnerResults: =>
86
- return unless @total.run
87
- @setText("stats-duration", @elapsedTime())
88
- @setStatus("passed") unless @total.failures
89
- @setText("stats-passes", @total.passes)
90
- @setText("stats-failures", @total.failures)
91
- if @total.run < @total.exist
92
- @total.skipped = @total.exist - @total.run
93
- @total.run = @total.exist
94
- @setText("stats-skipped", @total.skipped)
95
- @updateProgress()
96
-
97
-
98
99
  elapsedTime: ->
99
100
  "#{((new Teaspoon.Date().getTime() - @start) / 1000).toFixed(3)}s"
100
101
 
@@ -105,10 +106,9 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
105
106
 
106
107
 
107
108
  updateStatus: (spec) ->
108
- spec = new Teaspoon.Spec(spec)
109
109
  result = spec.result()
110
110
 
111
- if result.skipped || result.status == "pending"
111
+ if result.skipped
112
112
  @updateStat("skipped", @total.skipped += 1)
113
113
  return
114
114
 
@@ -117,10 +117,13 @@ class Teaspoon.Reporters.HTML extends Teaspoon.Reporters.BaseView
117
117
  if result.status == "passed"
118
118
  @updateStat("passes", @total.passes += 1)
119
119
  @reportView?.updateState("passed", elapsed)
120
+ else if result.status == "pending"
121
+ @reportView?.updateState("pending", elapsed)
120
122
  else
121
123
  @updateStat("failures", @total.failures += 1)
122
124
  @reportView?.updateState("failed", elapsed)
123
- new Teaspoon.Reporters.HTML.FailureView(spec).appendTo(@findEl("report-failures")) unless @config["build-full-report"]
125
+ unless @config["build-full-report"]
126
+ new (Teaspoon.resolveClass("Reporters.HTML.FailureView"))(spec).appendTo(@findEl("report-failures"))
124
127
  @setStatus("failed")
125
128
 
126
129