jasmine-headless-webkit-firstbanco 0.9.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rspec +1 -0
  4. data/CHANGELOG.md +89 -0
  5. data/Gemfile +30 -0
  6. data/Guardfile +41 -0
  7. data/README.md +44 -0
  8. data/Rakefile +65 -0
  9. data/bin/jasmine-headless-webkit +11 -0
  10. data/config/cucumber.yml +2 -0
  11. data/ext/jasmine-webkit-specrunner/Info.plist +22 -0
  12. data/ext/jasmine-webkit-specrunner/Makefile.dummy +5 -0
  13. data/ext/jasmine-webkit-specrunner/Page.cpp +15 -0
  14. data/ext/jasmine-webkit-specrunner/Page.h +20 -0
  15. data/ext/jasmine-webkit-specrunner/Runner.cpp +208 -0
  16. data/ext/jasmine-webkit-specrunner/Runner.h +73 -0
  17. data/ext/jasmine-webkit-specrunner/common.pri +8 -0
  18. data/ext/jasmine-webkit-specrunner/extconf.rb +10 -0
  19. data/ext/jasmine-webkit-specrunner/specrunner.cpp +79 -0
  20. data/ext/jasmine-webkit-specrunner/specrunner.pro +5 -0
  21. data/features/bin/failure.feature +7 -0
  22. data/features/bin/files.feature +7 -0
  23. data/features/bin/filtered_run/both_runs.feature +18 -0
  24. data/features/bin/filtered_run/no_full_run.feature +14 -0
  25. data/features/bin/help.feature +7 -0
  26. data/features/bin/quiet_messages.feature +8 -0
  27. data/features/bin/runner_out.feature +8 -0
  28. data/features/bin/spec_files_with_same_basename.feature +7 -0
  29. data/features/bin/success.feature +20 -0
  30. data/features/bin/success_with_js_error.feature +5 -0
  31. data/features/bin/tries_to_leave_page.feature +7 -0
  32. data/features/bin/try_to_click_a_button.feature +7 -0
  33. data/features/bin/two_files_from_src_files.feature +11 -0
  34. data/features/bin/with_coffeescript_error.feature +7 -0
  35. data/features/bin/with_console_log.feature +7 -0
  36. data/features/bin/with_server.feature +7 -0
  37. data/features/bin/with_window_prompt.feature +7 -0
  38. data/features/reporters.feature +24 -0
  39. data/features/runner.feature +34 -0
  40. data/features/steps/given/i_have_test_suite.rb +2 -0
  41. data/features/steps/given/no_existing_file.rb +4 -0
  42. data/features/steps/given/options/i_have_defaults.rb +4 -0
  43. data/features/steps/given/options/i_have_reporters.rb +10 -0
  44. data/features/steps/given/options/i_have_runner_options.rb +3 -0
  45. data/features/steps/then/bin/exit_status_should_be.rb +3 -0
  46. data/features/steps/then/bin/file_should_contain_runner.rb +4 -0
  47. data/features/steps/then/bin/following_files_loaded_in_order.rb +10 -0
  48. data/features/steps/then/bin/i_should_get_help_output.rb +4 -0
  49. data/features/steps/then/bin/output_should_include.rb +3 -0
  50. data/features/steps/then/bin/output_should_not_include.rb +4 -0
  51. data/features/steps/then/reporting/report_does_not_exist.rb +4 -0
  52. data/features/steps/then/reporting/report_should_exist.rb +3 -0
  53. data/features/steps/then/reporting/report_should_have.rb +7 -0
  54. data/features/steps/then/reporting/report_should_have_seed.rb +4 -0
  55. data/features/steps/then/runner/it_should_have_exit_status.rb +3 -0
  56. data/features/steps/then/runner/it_should_include_report_file.rb +4 -0
  57. data/features/steps/then/runner/it_should_not_include_report_file.rb +3 -0
  58. data/features/steps/then/templates/it_should_use_reporter.rb +6 -0
  59. data/features/steps/when/i_delete_file.rb +3 -0
  60. data/features/steps/when/i_get_runner.rb +4 -0
  61. data/features/steps/when/i_get_template_writer.rb +4 -0
  62. data/features/steps/when/i_run_executable.rb +4 -0
  63. data/features/steps/when/i_run_runner.rb +4 -0
  64. data/features/support/env.rb +7 -0
  65. data/jasmine-headless-webkit-firstbanco.gemspec +30 -0
  66. data/lib/autotest/discover.rb +1 -0
  67. data/lib/autotest/jasmine.rb +7 -0
  68. data/lib/autotest/jasmine_mixin.rb +111 -0
  69. data/lib/autotest/jasmine_rspec2.rb +7 -0
  70. data/lib/jasmine-headless-webkit.rb +3 -0
  71. data/lib/jasmine/headless.rb +61 -0
  72. data/lib/jasmine/headless/cacheable_action.rb +85 -0
  73. data/lib/jasmine/headless/coffee_script_cache.rb +20 -0
  74. data/lib/jasmine/headless/coffee_template.rb +36 -0
  75. data/lib/jasmine/headless/command_line.rb +31 -0
  76. data/lib/jasmine/headless/css_template.rb +19 -0
  77. data/lib/jasmine/headless/errors.rb +16 -0
  78. data/lib/jasmine/headless/file_checker.rb +25 -0
  79. data/lib/jasmine/headless/files_list.rb +332 -0
  80. data/lib/jasmine/headless/js_template.rb +23 -0
  81. data/lib/jasmine/headless/jst_template.rb +15 -0
  82. data/lib/jasmine/headless/nil_template.rb +14 -0
  83. data/lib/jasmine/headless/options.rb +206 -0
  84. data/lib/jasmine/headless/railtie.rb +12 -0
  85. data/lib/jasmine/headless/report.rb +81 -0
  86. data/lib/jasmine/headless/report_message.rb +12 -0
  87. data/lib/jasmine/headless/report_message/console.rb +18 -0
  88. data/lib/jasmine/headless/report_message/error.rb +20 -0
  89. data/lib/jasmine/headless/report_message/fail.rb +5 -0
  90. data/lib/jasmine/headless/report_message/pass.rb +5 -0
  91. data/lib/jasmine/headless/report_message/seed.rb +14 -0
  92. data/lib/jasmine/headless/report_message/spec.rb +28 -0
  93. data/lib/jasmine/headless/report_message/total.rb +31 -0
  94. data/lib/jasmine/headless/runner.rb +264 -0
  95. data/lib/jasmine/headless/spec_file_analyzer.rb +44 -0
  96. data/lib/jasmine/headless/task.rb +39 -0
  97. data/lib/jasmine/headless/template_writer.rb +65 -0
  98. data/lib/jasmine/headless/unique_asset_list.rb +16 -0
  99. data/lib/jasmine/headless/version.rb +5 -0
  100. data/lib/qt/qmake.rb +155 -0
  101. data/script/gemfile +11 -0
  102. data/script/hooks/post-commit +4 -0
  103. data/script/hooks/pre-commit +15 -0
  104. data/script/initialize-environment +35 -0
  105. data/script/install-git-hooks +6 -0
  106. data/skel/template.html.erb +77 -0
  107. data/spec/files/UTF-8-test.txt +0 -0
  108. data/spec/integration/randomization_spec.rb +13 -0
  109. data/spec/integration/specify_runner_file_spec.rb +22 -0
  110. data/spec/integration/sprockets_spec.rb +23 -0
  111. data/spec/jasmine/click_button/click_button.js +5 -0
  112. data/spec/jasmine/click_button/click_button.yml +12 -0
  113. data/spec/jasmine/click_button/click_button_spec.js +11 -0
  114. data/spec/jasmine/coffeescript_error/coffeescript_error.yml +10 -0
  115. data/spec/jasmine/coffeescript_error/spec.coffee +2 -0
  116. data/spec/jasmine/coffeescript_error/src.coffee +2 -0
  117. data/spec/jasmine/console_log/console_log.js +1 -0
  118. data/spec/jasmine/console_log/console_log.yml +10 -0
  119. data/spec/jasmine/console_log/console_log_spec.js +7 -0
  120. data/spec/jasmine/failure/failure.js +1 -0
  121. data/spec/jasmine/failure/failure.yml +9 -0
  122. data/spec/jasmine/failure/failure_spec.js +6 -0
  123. data/spec/jasmine/filtered_failure/failure_spec.js +6 -0
  124. data/spec/jasmine/filtered_failure/filtered_failure.yml +10 -0
  125. data/spec/jasmine/filtered_failure/src.js +0 -0
  126. data/spec/jasmine/filtered_failure/success_spec.js +6 -0
  127. data/spec/jasmine/filtered_success/filtered_success.yml +10 -0
  128. data/spec/jasmine/filtered_success/src.js +0 -0
  129. data/spec/jasmine/filtered_success/success_one_spec.js +6 -0
  130. data/spec/jasmine/filtered_success/success_other_file.js +7 -0
  131. data/spec/jasmine/filtered_success/success_two_spec.js +6 -0
  132. data/spec/jasmine/filtered_success_with_console/filtered_success.yml +10 -0
  133. data/spec/jasmine/filtered_success_with_console/src.js +0 -0
  134. data/spec/jasmine/filtered_success_with_console/success_one_spec.js +7 -0
  135. data/spec/jasmine/filtered_success_with_console/success_two_spec.js +6 -0
  136. data/spec/jasmine/leave_page/leave_page.js +4 -0
  137. data/spec/jasmine/leave_page/leave_page.yml +9 -0
  138. data/spec/jasmine/leave_page/leave_page_spec.js +11 -0
  139. data/spec/jasmine/noisy/file.js.erb +0 -0
  140. data/spec/jasmine/noisy/noisy.yml +8 -0
  141. data/spec/jasmine/noisy/other_file.js +2 -0
  142. data/spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml +11 -0
  143. data/spec/jasmine/runner_out_in_jasmine_yml/test.js +2 -0
  144. data/spec/jasmine/runner_out_in_jasmine_yml/test_spec.coffee +4 -0
  145. data/spec/jasmine/success/success.js +1 -0
  146. data/spec/jasmine/success/success.yml +9 -0
  147. data/spec/jasmine/success/success_spec.js +6 -0
  148. data/spec/jasmine/success_with_error/success_with_error.js +3 -0
  149. data/spec/jasmine/success_with_error/success_with_error.yml +9 -0
  150. data/spec/jasmine/success_with_error/success_with_error_spec.js +6 -0
  151. data/spec/jasmine/two_files_from_src_files/app/app-file.js +0 -0
  152. data/spec/jasmine/two_files_from_src_files/app/app.js +2 -0
  153. data/spec/jasmine/two_files_from_src_files/jasmine.yml +7 -0
  154. data/spec/jasmine/two_files_from_src_files/vendor/vendor-file.js +0 -0
  155. data/spec/jasmine/two_files_from_src_files/vendor/vendor.js +2 -0
  156. data/spec/jasmine/two_spec_files_same_basename/jasmine.yml +6 -0
  157. data/spec/jasmine/two_spec_files_same_basename/spec.coffee +4 -0
  158. data/spec/jasmine/two_spec_files_same_basename/spec.js +6 -0
  159. data/spec/jasmine/window_prompt/source.js +2 -0
  160. data/spec/jasmine/window_prompt/window_prompt.yml +4 -0
  161. data/spec/jasmine/with_sprockets_includes/assets/application.js.erb +2 -0
  162. data/spec/jasmine/with_sprockets_includes/assets/things/code.js +6 -0
  163. data/spec/jasmine/with_sprockets_includes/assets/things/jquery.string.js +0 -0
  164. data/spec/jasmine/with_sprockets_includes/assets/things/required.js +3 -0
  165. data/spec/jasmine/with_sprockets_includes/assets/things/subcode/more_code.js +2 -0
  166. data/spec/jasmine/with_sprockets_includes/assets/things/templates/that.jst.ejs +1 -0
  167. data/spec/jasmine/with_sprockets_includes/assets/things/templates/this.jst +2 -0
  168. data/spec/jasmine/with_sprockets_includes/spec/spec_helper.js +1 -0
  169. data/spec/jasmine/with_sprockets_includes/spec/things/code_spec.js +9 -0
  170. data/spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml +12 -0
  171. data/spec/javascripts/console.log_spec.coffee +15 -0
  172. data/spec/javascripts/headless_reporter_result_spec.coffee +30 -0
  173. data/spec/javascripts/helpers/spec_helper.coffee +2 -0
  174. data/spec/javascripts/jasmine-extensions_spec.coffee +80 -0
  175. data/spec/javascripts/jasmine.HeadlessReporter.ConsoleBase_spec.coffee +35 -0
  176. data/spec/javascripts/jasmine.HeadlessReporter.Console_spec.coffee +3 -0
  177. data/spec/javascripts/jasmine.HeadlessReporter.Tap_spec.coffee +19 -0
  178. data/spec/javascripts/jasmine.HeadlessReporter_spec.coffee +27 -0
  179. data/spec/javascripts/support/jasmine.yml +9 -0
  180. data/spec/lib/jasmine/headless/cacheable_action_spec.rb +122 -0
  181. data/spec/lib/jasmine/headless/coffee_script_cache_spec.rb +21 -0
  182. data/spec/lib/jasmine/headless/coffee_template_spec.rb +55 -0
  183. data/spec/lib/jasmine/headless/css_template_spec.rb +25 -0
  184. data/spec/lib/jasmine/headless/file_checker_spec.rb +41 -0
  185. data/spec/lib/jasmine/headless/files_list_spec.rb +194 -0
  186. data/spec/lib/jasmine/headless/js_template_spec.rb +31 -0
  187. data/spec/lib/jasmine/headless/jst_template_spec.rb +21 -0
  188. data/spec/lib/jasmine/headless/nil_template_spec.rb +31 -0
  189. data/spec/lib/jasmine/headless/options_spec.rb +194 -0
  190. data/spec/lib/jasmine/headless/report_message/seed_spec.rb +18 -0
  191. data/spec/lib/jasmine/headless/report_message/spec_spec.rb +20 -0
  192. data/spec/lib/jasmine/headless/report_spec.rb +95 -0
  193. data/spec/lib/jasmine/headless/runner_spec.rb +247 -0
  194. data/spec/lib/jasmine/headless/spec_file_analyzer_spec.rb +68 -0
  195. data/spec/lib/jasmine/headless/task_spec.rb +92 -0
  196. data/spec/lib/jasmine/headless/template_writer_spec.rb +92 -0
  197. data/spec/lib/jasmine/headless/unique_asset_list_spec.rb +22 -0
  198. data/spec/lib/jasmine/headless_spec.rb +38 -0
  199. data/spec/lib/qt/qmake_spec.rb +142 -0
  200. data/spec/skel/template.html.erb_spec.rb +8 -0
  201. data/spec/spec_helper.rb +113 -0
  202. data/vendor/assets/coffeescripts/headless_reporter_result.coffee +49 -0
  203. data/vendor/assets/coffeescripts/prolog.coffee +100 -0
  204. data/vendor/assets/javascripts/beautify-html.js +463 -0
  205. data/vendor/assets/javascripts/headless_reporter_result.js +79 -0
  206. data/vendor/assets/javascripts/intense.coffee +28 -0
  207. data/vendor/assets/javascripts/jasmine-extensions.coffee +97 -0
  208. data/vendor/assets/javascripts/jasmine.HeadlessReporter.Console.coffee +8 -0
  209. data/vendor/assets/javascripts/jasmine.HeadlessReporter.ConsoleBase.coffee +92 -0
  210. data/vendor/assets/javascripts/jasmine.HeadlessReporter.File.coffee +24 -0
  211. data/vendor/assets/javascripts/jasmine.HeadlessReporter.Tap.coffee +28 -0
  212. data/vendor/assets/javascripts/jasmine.HeadlessReporter.Verbose.coffee +64 -0
  213. data/vendor/assets/javascripts/jasmine.HeadlessReporter.coffee +58 -0
  214. data/vendor/assets/javascripts/jsDump.js +209 -0
  215. data/vendor/assets/javascripts/prolog.js +108 -0
  216. metadata +347 -0
@@ -0,0 +1,7 @@
1
+ describe('console.log', function() {
2
+ it('should succeed, but with a console.log', function() {
3
+ console.log("hello");
4
+ expect(success).toEqual(1);
5
+ });
6
+ });
7
+
@@ -0,0 +1 @@
1
+ var failure = 0;
@@ -0,0 +1,9 @@
1
+ src_files:
2
+ - spec/jasmine/failure/failure.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/failure/failure_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
@@ -0,0 +1,6 @@
1
+ describe('failure', function() {
2
+ it("should fail with error code of 1", function() {
3
+ expect(failure).toEqual(1);
4
+ });
5
+ });
6
+
@@ -0,0 +1,6 @@
1
+ describe('fail', function() {
2
+ it('should fail', function() {
3
+ expect(false).toEqual(true);
4
+ });
5
+ });
6
+
@@ -0,0 +1,10 @@
1
+ src_files:
2
+ - spec/jasmine/filtered_failure/src.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/filtered_failure/*_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
10
+
File without changes
@@ -0,0 +1,6 @@
1
+ describe('success', function() {
2
+ it('should succeed', function() {
3
+ expect(true).toEqual(true);
4
+ });
5
+ });
6
+
@@ -0,0 +1,10 @@
1
+ src_files:
2
+ - spec/jasmine/filtered_success/src.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/filtered_success/*_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
10
+
File without changes
@@ -0,0 +1,6 @@
1
+ describe('success', function() {
2
+ it('should succeed', function() {
3
+ expect(true).toEqual(true);
4
+ });
5
+ });
6
+
@@ -0,0 +1,7 @@
1
+ describe('outside success', function() {
2
+ it('should succeed', function() {
3
+ expect(true).toEqual(true);
4
+ });
5
+ });
6
+
7
+
@@ -0,0 +1,6 @@
1
+ describe('also success', function() {
2
+ it('should succeed', function() {
3
+ expect(true).toEqual(true);
4
+ });
5
+ });
6
+
@@ -0,0 +1,10 @@
1
+ src_files:
2
+ - spec/jasmine/filtered_success_with_console/src.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/filtered_success_with_console/*_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
10
+
@@ -0,0 +1,7 @@
1
+ describe('success', function() {
2
+ it('should succeed', function() {
3
+ console.log("made it");
4
+ expect(true).toEqual(true);
5
+ });
6
+ });
7
+
@@ -0,0 +1,6 @@
1
+ describe('also success', function() {
2
+ it('should succeed', function() {
3
+ expect(true).toEqual(true);
4
+ });
5
+ });
6
+
@@ -0,0 +1,4 @@
1
+ function yes() {
2
+ document.location.href = 'http://www.google.com/'
3
+ }
4
+
@@ -0,0 +1,9 @@
1
+ src_files:
2
+ - spec/jasmine/leave_page/leave_page.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/leave_page/leave_page_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
@@ -0,0 +1,11 @@
1
+ describe("something", function() {
2
+ it("should be true", function() {
3
+ yes();
4
+ expect(true).toEqual(true);
5
+ });
6
+
7
+ it("should so something else", function() {
8
+ expect(true).toEqual(true);
9
+ });
10
+ });
11
+
File without changes
@@ -0,0 +1,8 @@
1
+ src_dir: spec/jasmine/noisy
2
+ src_files:
3
+ - '**/*'
4
+
5
+ spec_dir: spec/jasmine/noisy
6
+ spec_files:
7
+ - '**/*'
8
+
@@ -0,0 +1,2 @@
1
+ window.prompt("hello");
2
+
@@ -0,0 +1,11 @@
1
+ src_dir: spec/jasmine/runner_out_in_jasmine_yml
2
+ spec_dir: spec/jasmine/runner_out_in_jasmine_yml
3
+
4
+ src_files:
5
+ - "*.js"
6
+
7
+ spec_files:
8
+ - "*_spec.coffee"
9
+
10
+ runner_output: 'spec/temp_out.html'
11
+
@@ -0,0 +1,2 @@
1
+ console.log("made it")
2
+
@@ -0,0 +1,4 @@
1
+ describe 'this', ->
2
+ it 'should be true', ->
3
+ expect(true).toEqual(true)
4
+
@@ -0,0 +1 @@
1
+ var success = 1;
@@ -0,0 +1,9 @@
1
+ src_files:
2
+ - spec/jasmine/success/success.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/success/success_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
@@ -0,0 +1,6 @@
1
+ describe('success', function() {
2
+ it("should be a success", function() {
3
+ expect(success).toEqual(1);
4
+ });
5
+ });
6
+
@@ -0,0 +1,3 @@
1
+ var good = 2;
2
+ var bad = null;
3
+ if (bad.myProperty) {}
@@ -0,0 +1,9 @@
1
+ src_files:
2
+ - spec/jasmine/success_with_error/success_with_error.js
3
+
4
+ spec_files:
5
+ - spec/jasmine/success_with_error/success_with_error_spec.js
6
+
7
+ src_dir: .
8
+ spec_dir: .
9
+
@@ -0,0 +1,6 @@
1
+ describe('Success with error', function() {
2
+ it("should not fail", function() {
3
+ expect(good).toEqual(2);
4
+ })
5
+ });
6
+
@@ -0,0 +1,2 @@
1
+ //= require app-file
2
+ //
@@ -0,0 +1,7 @@
1
+ src_dir: spec/jasmine/two_files_from_src_files/app
2
+
3
+ asset_paths:
4
+ - "spec/jasmine/two_files_from_src_files/vendor"
5
+
6
+ src_files: [ 'vendor.js', 'app.js' ]
7
+
@@ -0,0 +1,2 @@
1
+ //= require vendor-file
2
+ //
@@ -0,0 +1,6 @@
1
+ src_dir: spec/jasmine/two_spec_files_same_basename
2
+ src_files: []
3
+
4
+ spec_dir: spec/jasmine/two_spec_files_same_basename
5
+ spec_files: [ "**/*.{js,coffee}" ]
6
+
@@ -0,0 +1,4 @@
1
+ describe 'two', ->
2
+ it 'should pass', ->
3
+ expect(true).toEqual(true)
4
+
@@ -0,0 +1,6 @@
1
+ describe("one", function() {
2
+ it('should pass', function() {
3
+ expect(true).toEqual(true);
4
+ });
5
+ });
6
+
@@ -0,0 +1,2 @@
1
+ window.prompt("Yes! Hi!");
2
+
@@ -0,0 +1,4 @@
1
+ src_dir: spec/jasmine/window_prompt
2
+ src_files:
3
+ - '**/*.js'
4
+
@@ -0,0 +1,2 @@
1
+ //= require 'jquery'
2
+ //= require_tree '.'
@@ -0,0 +1,6 @@
1
+ //= require 'jquery'
2
+ //= require_tree './templates'
3
+ //= require 'things/required'
4
+
5
+ window.a = '1';
6
+
@@ -0,0 +1,3 @@
1
+ //= require 'jquery'
2
+ //= require 'things/jquery.string'
3
+
@@ -0,0 +1,2 @@
1
+ //= require 'things/required'
2
+
@@ -0,0 +1 @@
1
+ //= require 'jquery'
@@ -0,0 +1,9 @@
1
+ //= require 'things/code'
2
+
3
+ describe('code', function() {
4
+ it('should equal 1', function() {
5
+ expect(window.a).toEqual(1)
6
+ expect(jQuery).not.toBeUndefined()
7
+ });
8
+ });
9
+
@@ -0,0 +1,12 @@
1
+ src_dir: spec/jasmine/with_sprockets_includes/assets
2
+ spec_dir: spec/jasmine/with_sprockets_includes/spec
3
+
4
+ spec_files:
5
+ - "**/*_spec.js"
6
+
7
+ src_files:
8
+ - "**/*"
9
+
10
+ helpers:
11
+ - "spec_helper.js"
12
+
@@ -0,0 +1,15 @@
1
+ #= require jquery
2
+
3
+ describe 'console.log', ->
4
+ it 'should not eat my precious jqueries', ->
5
+ _log = JHW.log
6
+
7
+ JHW.log = ->
8
+
9
+ d = $('<div><div id="inner">b</div></div>');
10
+ expect(d.find('#inner').length).toBe(1);
11
+ console.log(d.find('#inner'));
12
+ expect(d.find('#inner').length).toBe(1);
13
+
14
+ JHW.log = _log
15
+
@@ -0,0 +1,30 @@
1
+ describe 'HeadlessReporterResult', ->
2
+ result = null
3
+ name = "name"
4
+ splitName = "splitName"
5
+ message = 'message'
6
+
7
+ context 'no lines', ->
8
+ beforeEach ->
9
+ result = new HeadlessReporterResult(name, splitName)
10
+
11
+ describe '#addResult', ->
12
+ it 'should add a message', ->
13
+ result.addResult(message)
14
+
15
+ expect(result.results).toEqual([ message ])
16
+
17
+ context 'with lines', ->
18
+ beforeEach ->
19
+ HeadlessReporterResult.specLineNumbers = {
20
+ 'one': {
21
+ 'name': [ 1 ],
22
+ 'of': [ 2, 9 ],
23
+ 'test': [ 3, 10 ],
24
+ 'other': [ 7 ]
25
+ }
26
+ }
27
+ it 'should find the best spec lines', ->
28
+ expect(HeadlessReporterResult.findSpecLine([ 'name', 'of', 'test' ]).lineNumber).toEqual(3)
29
+ expect(HeadlessReporterResult.findSpecLine([ 'other', 'of', 'test' ]).lineNumber).toEqual(10)
30
+
@@ -0,0 +1,2 @@
1
+ window.context = window.describe
2
+
@@ -0,0 +1,80 @@
1
+ describe 'jasmine.Suite.prototype.getSuiteSplitName', ->
2
+ it 'should flatten the description', ->
3
+ suite = new jasmine.Suite({});
4
+ suite.description = "hello\ngoodbye\n";
5
+ expect(suite.getSuiteSplitName()).toEqual([ "hello goodbye " ])
6
+
7
+ it 'should not fail on missing description', ->
8
+ suite = new jasmine.Suite({});
9
+ suite.description = 1;
10
+ expect(suite.getSuiteSplitName()).toEqual([ "1" ])
11
+
12
+ describe 'jasmine.Spec.prototype.getSuiteSplitName', ->
13
+ it 'should flatten the description', ->
14
+ spec = new jasmine.Spec({}, {});
15
+ spec.suite = {
16
+ getSuiteSplitName: -> []
17
+ }
18
+ spec.description = "hello\ngoodbye\n";
19
+ expect(spec.getSpecSplitName()).toEqual([ "hello goodbye " ])
20
+
21
+ it 'should not fail on missing description', ->
22
+ spec = new jasmine.Spec({}, {});
23
+ spec.suite = {
24
+ getSuiteSplitName: -> []
25
+ }
26
+ spec.description = 1
27
+ expect(spec.getSpecSplitName()).toEqual([ "1" ])
28
+
29
+ describe 'jasmine.Spec.prototype.getJHWSpecInformation', ->
30
+ it 'should append null when there is no file information', ->
31
+ spec = new jasmine.Spec({}, {})
32
+ spyOn(spec, 'getSpecSplitName').andReturn(["one"])
33
+ spyOn(HeadlessReporterResult, 'findSpecLine').andReturn({})
34
+ expect(spec.getJHWSpecInformation()).toEqual("one||")
35
+
36
+ describe 'jasmine.WaitsBlock and jasmine.WaitsForBlock', ->
37
+ beforeEach ->
38
+ it 'should notify JHW of waiting', ->
39
+ waits(5500)
40
+ runs ->
41
+ expect(true).toEqual(true)
42
+
43
+ it 'should notify JHW of waiting for something', ->
44
+ value = false
45
+
46
+ setTimeout(
47
+ ->
48
+ value = true
49
+ , 5000
50
+ )
51
+
52
+ waitsFor(
53
+ ->
54
+ value
55
+ , "Nope"
56
+ 5500
57
+ )
58
+
59
+ runs ->
60
+ expect(true).toEqual(true)
61
+
62
+ describe 'jasmine.NestedResults.isValidSpecLine', ->
63
+ it 'should check the lines', ->
64
+ expect(jasmine.NestedResults.isValidSpecLine('yes')).toEqual(false)
65
+ expect(jasmine.NestedResults.isValidSpecLine('expect')).toEqual(true)
66
+ expect(jasmine.NestedResults.isValidSpecLine(' expect')).toEqual(true)
67
+ expect(jasmine.NestedResults.isValidSpecLine('return expect')).toEqual(true)
68
+ expect(jasmine.NestedResults.isValidSpecLine(' return expect')).toEqual(true)
69
+
70
+ describe 'jasmine.nestedResults.parseFunction', ->
71
+ it 'should parse the function', ->
72
+ expect(jasmine.NestedResults.parseFunction("""
73
+ test
74
+ expect("cat")
75
+ return expect("dog")
76
+ """)).toEqual([
77
+ [ 'expect("cat")', 1 ],
78
+ [ 'expect("dog")', 2 ]
79
+ ])
80
+