jazz 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +129 -0
  3. data/bin/jazz +230 -0
  4. data/doc/jasmine/files.html +460 -0
  5. data/doc/jasmine/index.html +322 -0
  6. data/doc/jasmine/symbols/_global_.html +1083 -0
  7. data/doc/jasmine/symbols/jasmine.Block.html +417 -0
  8. data/doc/jasmine/symbols/jasmine.Clock.html +678 -0
  9. data/doc/jasmine/symbols/jasmine.Env.html +1135 -0
  10. data/doc/jasmine/symbols/jasmine.EnvjsReporter.html +328 -0
  11. data/doc/jasmine/symbols/jasmine.JsApiReporter.html +822 -0
  12. data/doc/jasmine/symbols/jasmine.Matchers.html +1106 -0
  13. data/doc/jasmine/symbols/jasmine.MultiReporter.html +394 -0
  14. data/doc/jasmine/symbols/jasmine.NestedResults.html +710 -0
  15. data/doc/jasmine/symbols/jasmine.Reporter.html +574 -0
  16. data/doc/jasmine/symbols/jasmine.Runner.html +710 -0
  17. data/doc/jasmine/symbols/jasmine.Spec.html +1372 -0
  18. data/doc/jasmine/symbols/jasmine.Spy.html +855 -0
  19. data/doc/jasmine/symbols/jasmine.Suite.html +705 -0
  20. data/doc/jasmine/symbols/jasmine.XMLReporter.html +328 -0
  21. data/doc/jasmine/symbols/jasmine.html +1359 -0
  22. data/doc/jasmine/symbols/jasmine.util.html +535 -0
  23. data/doc/jasmine/symbols/src/lib_EnvjsReporter.js.html +149 -0
  24. data/doc/jasmine/symbols/src/lib_TrivialReporter.js.html +127 -0
  25. data/doc/jasmine/symbols/src/lib_XMLReporter.js.html +210 -0
  26. data/doc/jasmine/symbols/src/src_Block.js.html +35 -0
  27. data/doc/jasmine/symbols/src/src_Env.js.html +233 -0
  28. data/doc/jasmine/symbols/src/src_JsApiReporter.js.html +110 -0
  29. data/doc/jasmine/symbols/src/src_Matchers.js.html +399 -0
  30. data/doc/jasmine/symbols/src/src_MultiReporter.js.html +36 -0
  31. data/doc/jasmine/symbols/src/src_NestedResults.js.html +88 -0
  32. data/doc/jasmine/symbols/src/src_PrettyPrinter.js.html +128 -0
  33. data/doc/jasmine/symbols/src/src_Queue.js.html +119 -0
  34. data/doc/jasmine/symbols/src/src_Reporter.js.html +35 -0
  35. data/doc/jasmine/symbols/src/src_Reporters.js.html +51 -0
  36. data/doc/jasmine/symbols/src/src_Runner.js.html +75 -0
  37. data/doc/jasmine/symbols/src/src_Spec.js.html +228 -0
  38. data/doc/jasmine/symbols/src/src_Suite.js.html +77 -0
  39. data/doc/jasmine/symbols/src/src_WaitsBlock.js.html +21 -0
  40. data/doc/jasmine/symbols/src/src_WaitsForBlock.js.html +45 -0
  41. data/doc/jasmine/symbols/src/src_base.js.html +566 -0
  42. data/doc/jasmine/symbols/src/src_mock-timeout.js.html +185 -0
  43. data/doc/jasmine/symbols/src/src_util.js.html +75 -0
  44. data/lib/jazz.rb +0 -0
  45. data/lib/jazz/intro.js +46 -0
  46. data/lib/jazz/jasmine/EnvjsReporter.js +141 -0
  47. data/lib/jazz/jasmine/TrivialReporter.js +155 -0
  48. data/lib/jazz/jasmine/XMLReporter.js +241 -0
  49. data/lib/jazz/jasmine/consolex.js +28 -0
  50. data/lib/jazz/jasmine/jasmine-0.10.0.js +2526 -0
  51. data/lib/jazz/jasmine/jasmine.js +2526 -0
  52. data/lib/jazz/jasmine/json2.js +478 -0
  53. data/lib/jazz/options.rb +26 -0
  54. data/lib/jazz/outro.js +3 -0
  55. data/lib/jazz/qintro.js +113 -0
  56. data/lib/jazz/qoutro.js +3 -0
  57. data/lib/jazz/qunit/qunit.css +17 -0
  58. data/lib/jazz/qunit/qunit.js +1027 -0
  59. data/spec/example/hello_world_spec.js +29 -0
  60. data/spec/example/nested/HelloWorldSpec.js +13 -0
  61. data/spec/example/nested/SpecHelper.js +1 -0
  62. data/spec/example/plain_spec.js +8 -0
  63. data/spec/example/spec_helper.js +1 -0
  64. data/spec/spec_helper.js +18 -0
  65. data/spec/spec_runner.js +143 -0
  66. data/test/jazz_test.rb +7 -0
  67. data/test/test_helper.rb +10 -0
  68. data/vendor/jasmine/MIT.LICENSE +20 -0
  69. data/vendor/jasmine/README.markdown +479 -0
  70. data/vendor/jasmine/Rakefile +155 -0
  71. data/vendor/jasmine/Wakefile +68 -0
  72. data/vendor/jasmine/contrib/ruby/jasmine_runner.rb +334 -0
  73. data/vendor/jasmine/contrib/ruby/jasmine_spec_builder.rb +153 -0
  74. data/vendor/jasmine/contrib/ruby/run.html +47 -0
  75. data/vendor/jasmine/contrib/ruby/spec/jasmine_runner_spec.rb +71 -0
  76. data/vendor/jasmine/doc/files.html +460 -0
  77. data/vendor/jasmine/doc/index.html +322 -0
  78. data/vendor/jasmine/doc/symbols/_global_.html +1083 -0
  79. data/vendor/jasmine/doc/symbols/jasmine.Block.html +417 -0
  80. data/vendor/jasmine/doc/symbols/jasmine.Clock.html +678 -0
  81. data/vendor/jasmine/doc/symbols/jasmine.Env.html +1135 -0
  82. data/vendor/jasmine/doc/symbols/jasmine.EnvjsReporter.html +328 -0
  83. data/vendor/jasmine/doc/symbols/jasmine.JsApiReporter.html +822 -0
  84. data/vendor/jasmine/doc/symbols/jasmine.Matchers.html +1106 -0
  85. data/vendor/jasmine/doc/symbols/jasmine.MultiReporter.html +394 -0
  86. data/vendor/jasmine/doc/symbols/jasmine.NestedResults.html +710 -0
  87. data/vendor/jasmine/doc/symbols/jasmine.Reporter.html +574 -0
  88. data/vendor/jasmine/doc/symbols/jasmine.Runner.html +710 -0
  89. data/vendor/jasmine/doc/symbols/jasmine.Spec.html +1372 -0
  90. data/vendor/jasmine/doc/symbols/jasmine.Spy.html +855 -0
  91. data/vendor/jasmine/doc/symbols/jasmine.Suite.html +705 -0
  92. data/vendor/jasmine/doc/symbols/jasmine.XMLReporter.html +328 -0
  93. data/vendor/jasmine/doc/symbols/jasmine.html +1359 -0
  94. data/vendor/jasmine/doc/symbols/jasmine.util.html +535 -0
  95. data/vendor/jasmine/doc/symbols/src/lib_EnvjsReporter.js.html +149 -0
  96. data/vendor/jasmine/doc/symbols/src/lib_TrivialReporter.js.html +127 -0
  97. data/vendor/jasmine/doc/symbols/src/lib_XMLReporter.js.html +210 -0
  98. data/vendor/jasmine/doc/symbols/src/src_Block.js.html +35 -0
  99. data/vendor/jasmine/doc/symbols/src/src_Env.js.html +233 -0
  100. data/vendor/jasmine/doc/symbols/src/src_JsApiReporter.js.html +110 -0
  101. data/vendor/jasmine/doc/symbols/src/src_Matchers.js.html +399 -0
  102. data/vendor/jasmine/doc/symbols/src/src_MultiReporter.js.html +36 -0
  103. data/vendor/jasmine/doc/symbols/src/src_NestedResults.js.html +88 -0
  104. data/vendor/jasmine/doc/symbols/src/src_PrettyPrinter.js.html +128 -0
  105. data/vendor/jasmine/doc/symbols/src/src_Queue.js.html +119 -0
  106. data/vendor/jasmine/doc/symbols/src/src_Reporter.js.html +35 -0
  107. data/vendor/jasmine/doc/symbols/src/src_Reporters.js.html +51 -0
  108. data/vendor/jasmine/doc/symbols/src/src_Runner.js.html +75 -0
  109. data/vendor/jasmine/doc/symbols/src/src_Spec.js.html +228 -0
  110. data/vendor/jasmine/doc/symbols/src/src_Suite.js.html +77 -0
  111. data/vendor/jasmine/doc/symbols/src/src_WaitsBlock.js.html +21 -0
  112. data/vendor/jasmine/doc/symbols/src/src_WaitsForBlock.js.html +45 -0
  113. data/vendor/jasmine/doc/symbols/src/src_base.js.html +566 -0
  114. data/vendor/jasmine/doc/symbols/src/src_mock-timeout.js.html +185 -0
  115. data/vendor/jasmine/doc/symbols/src/src_util.js.html +75 -0
  116. data/vendor/jasmine/examples/html/example_suite.html +27 -0
  117. data/vendor/jasmine/examples/html/spec/example_suite.js +11 -0
  118. data/vendor/jasmine/examples/ruby/Rakefile +33 -0
  119. data/vendor/jasmine/examples/ruby/spec/example/example_spec.js +11 -0
  120. data/vendor/jasmine/examples/ruby/spec/jasmine_helper.rb +41 -0
  121. data/vendor/jasmine/examples/ruby/spec/jasmine_spec.rb +31 -0
  122. data/vendor/jasmine/examples/ruby/spec/saucelabs.yml +24 -0
  123. data/vendor/jasmine/geminstaller.yml +23 -0
  124. data/vendor/jasmine/images/fail-16.png +0 -0
  125. data/vendor/jasmine/images/fail.png +0 -0
  126. data/vendor/jasmine/images/go-16.png +0 -0
  127. data/vendor/jasmine/images/go.png +0 -0
  128. data/vendor/jasmine/images/pending-16.png +0 -0
  129. data/vendor/jasmine/images/pending.png +0 -0
  130. data/vendor/jasmine/images/question-bk.png +0 -0
  131. data/vendor/jasmine/images/questionbk-16.png +0 -0
  132. data/vendor/jasmine/images/spinner.gif +0 -0
  133. data/vendor/jasmine/lib/EnvjsReporter.js +141 -0
  134. data/vendor/jasmine/lib/TrivialReporter.js +155 -0
  135. data/vendor/jasmine/lib/XMLReporter.js +241 -0
  136. data/vendor/jasmine/lib/consolex.js +28 -0
  137. data/vendor/jasmine/lib/jasmine-0.10.0.js +2526 -0
  138. data/vendor/jasmine/lib/jasmine.css +86 -0
  139. data/vendor/jasmine/lib/json2.js +478 -0
  140. data/vendor/jasmine/spec/jasmine_helper.rb +44 -0
  141. data/vendor/jasmine/spec/jasmine_spec.rb +31 -0
  142. data/vendor/jasmine/spec/runner.html +43 -0
  143. data/vendor/jasmine/spec/runner.js +78 -0
  144. data/vendor/jasmine/spec/saucelabs.yml +24 -0
  145. data/vendor/jasmine/spec/suites/EnvSpec.js +71 -0
  146. data/vendor/jasmine/spec/suites/ExceptionsSpec.js +107 -0
  147. data/vendor/jasmine/spec/suites/JsApiReporterSpec.js +82 -0
  148. data/vendor/jasmine/spec/suites/MatchersSpec.js +589 -0
  149. data/vendor/jasmine/spec/suites/MockClockSpec.js +34 -0
  150. data/vendor/jasmine/spec/suites/MultiReporterSpec.js +30 -0
  151. data/vendor/jasmine/spec/suites/NestedResultsSpec.js +54 -0
  152. data/vendor/jasmine/spec/suites/PrettyPrintSpec.js +93 -0
  153. data/vendor/jasmine/spec/suites/QueueSpec.js +23 -0
  154. data/vendor/jasmine/spec/suites/ReporterSpec.js +60 -0
  155. data/vendor/jasmine/spec/suites/RunnerSpec.js +258 -0
  156. data/vendor/jasmine/spec/suites/SpecRunningSpec.js +1117 -0
  157. data/vendor/jasmine/spec/suites/SpecSpec.js +110 -0
  158. data/vendor/jasmine/spec/suites/SpySpec.js +187 -0
  159. data/vendor/jasmine/spec/suites/SuiteSpec.js +101 -0
  160. data/vendor/jasmine/spec/suites/TrivialReporterSpec.js +140 -0
  161. data/vendor/jasmine/spec/suites/UtilSpec.js +23 -0
  162. data/vendor/jasmine/src/Block.js +34 -0
  163. data/vendor/jasmine/src/Env.js +236 -0
  164. data/vendor/jasmine/src/JsApiReporter.js +103 -0
  165. data/vendor/jasmine/src/Matchers.js +326 -0
  166. data/vendor/jasmine/src/MultiReporter.js +28 -0
  167. data/vendor/jasmine/src/NestedResults.js +99 -0
  168. data/vendor/jasmine/src/PrettyPrinter.js +122 -0
  169. data/vendor/jasmine/src/Queue.js +210 -0
  170. data/vendor/jasmine/src/Reporter.js +27 -0
  171. data/vendor/jasmine/src/Reporters.js +43 -0
  172. data/vendor/jasmine/src/Runner.js +68 -0
  173. data/vendor/jasmine/src/Spec.js +254 -0
  174. data/vendor/jasmine/src/Suite.js +70 -0
  175. data/vendor/jasmine/src/WaitsBlock.js +13 -0
  176. data/vendor/jasmine/src/WaitsForBlock.js +38 -0
  177. data/vendor/jasmine/src/base.js +604 -0
  178. data/vendor/jasmine/src/mock-timeout.js +177 -0
  179. data/vendor/jasmine/src/util.js +67 -0
  180. data/vendor/jasmine/src/version.json +5 -0
  181. metadata +292 -0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Steven Parkes
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,129 @@
1
+ = jazz
2
+
3
+ Jazz provides support for running JavaScript specs written using
4
+ frameworks such as Jasmine under env.js. It includes support for
5
+ running via wake.
6
+
7
+ Discussion at http://groups.google.com/group/jazz-talk or #jazz-talk at freenode.
8
+
9
+ == Install
10
+
11
+ You can install the gem via <tt>gem install smparkes-jazz</tt>. If
12
+ you want to install from github (http://github.com/smparkes/jazz),
13
+ you'll need to checkout the Jasmine submodule (<tt>git submodule
14
+ update --init</tt>) and also need to make sure you have the
15
+ prerequisites listed in the gemspec in the Rakefile. <tt>rake
16
+ gemspec</tt> will then build and copy the necessary parts of Jasmine.
17
+
18
+ If you want to run the examples/tests, you'll need jQuery. The <tt>git
19
+ submodule update --init</tt> command will have brought in jQuery, but
20
+ you'll need to build it: <tt>cd vendor/jquery && make</tt>.
21
+
22
+ Even if you install the gem, you may want to get the github files to
23
+ see and run the examples.
24
+
25
+ == Use
26
+
27
+ From the root of a project, i.e., the parent of the <tt>spec</tt>
28
+ directory, you can use the <tt>jazz</tt> command as you would the
29
+ rspec <tt>spec</tt> command, e.g.,
30
+
31
+ jazz spec/foo_spec.js spec/bar_spec.js
32
+
33
+ You can also execute HTML specs via jazz:
34
+
35
+ jazz spec/foo_spec.html
36
+
37
+ or even normal pages, that have the proper hooks to run as examples
38
+ (see below).
39
+
40
+ HTML files must be valid XML, i.e., XHTML, at this time.
41
+
42
+ The HTML fixture must load the necessary test files. Any number of
43
+ fixtures can be passed to the <tt>jazz</tt> command.
44
+
45
+ jazz uses env.js to run the tests, feeding it your HTML and
46
+ JavaScript, plus the necessary JavaScript and controls to make the tests
47
+ run correctly. You can see the entire <tt>envjsrb</tt> command by
48
+ passing <tt>jazz</tt> the <tt>-v</tt> flag.
49
+
50
+ The Jasmine tests are configured to report results in streaming XML
51
+ (JUnit format, more or less), which <tt>jazz</tt> turns into the
52
+ familiar rspec format. The <tt>--xml</tt> flag
53
+ causes <tt>jazz</tt> to display the raw XML output.
54
+
55
+ To run all the tests in the <tt>spec</tt> directory repeatedly you can
56
+ use wake:
57
+
58
+ rake test
59
+
60
+ or
61
+
62
+ wake
63
+
64
+ See jazz's <tt>Wakefile</tt> file and the
65
+ discussion on examples below.
66
+
67
+ You can also try using <tt>autojaz</tt> as
68
+ you would use <tt>autospec</tt>:
69
+
70
+ autojaz
71
+
72
+ You'll need to install the ZenTest gem if you don't have it installed;
73
+ <tt>jazz</tt> can be used without ZenTest installed, but
74
+ <tt>autojaz</tt> cannot be. Note that <tt>autojaz</tt> may be
75
+ deprecated in favor of <tt>wake</tt>.
76
+
77
+ Screen shot at http://www.scrnshots.com/users/smparkes/screenshots/206033
78
+
79
+ == Examples
80
+
81
+ There are examples in <tt>examples/*</tt> and <tt>spec/examples/*</tt>. You can run the
82
+ tests with <tt>rake test</tt> which will run wake against the Wakefile.
83
+ (Wake as a runner will probably replace
84
+ autojaz.) You'll need the wake gem.
85
+
86
+ Running wake will run all the
87
+ tests and then watch the file system for changes. When it sees a change,
88
+ it reruns the test. It knows how to find the HTML fixtures for specs
89
+ where they exist in the right place, or it just runs the JavaScript
90
+ spec itself. An example of the former is the pair
91
+ <tt>example/hello_world.html</tt> and
92
+ <tt>spec/example/hello_world_spec.js</tt>: jazz will reload the HTML if either file is changed.
93
+ An example of the latter
94
+ is <tt>spec/example/plain_spec.js</tt>.
95
+
96
+ You can also load the individual HTML files in the browser to run the
97
+ tests there. For example, on a Mac, <tt>open
98
+ example/hello_world.html</tt>. (The idea is that for production, the
99
+ spec helper files are changed to not load the tests: that should be
100
+ the only change necessary. Or the <tt><script></tt> tag could be
101
+ ripped out.) Note that to run the tests from the filesystem in Firefox, you'll
102
+ need to set the <tt>security.fileuri.strict_origin_policy</tt> option
103
+ to true.
104
+
105
+ == Recent Changes
106
+
107
+ 1. Pass dependence flag to envjsrb to support wake dependences
108
+
109
+ 1. Add wake support
110
+
111
+ 1. Add example
112
+
113
+ 1. Support multiple fixtures on the <tt>jazz</tt> command. (Actually, this is entirely due to <tt>envjsrb</tt> supporting multiple fixtures. You need a recent build from github or an smparkes-envjs gem version of at least 0.0.5.)
114
+
115
+ == Things to do
116
+
117
+ 1. Complete and test support for loading against an HTTP server.
118
+
119
+ 1. Focus on failing tests until fixed, a la autotest.
120
+
121
+ 1. Extend to more frameworks, e.g., qunit. There's little here that's actually Jasmine-specific.
122
+
123
+ 1. Including a missing script should be an error
124
+
125
+ 1. Make work in interactive mode (requires intro/outro/out:blank intergration with envjsrb)
126
+
127
+ == Copyright
128
+
129
+ Copyright (c) 2009 Steven Parkes. See LICENSE for details.
@@ -0,0 +1,230 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $VERBOSE = true
4
+
5
+ require 'jazz/options'
6
+
7
+ ENV["JAZZ_JS_PATH"] =
8
+ JAZ_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'jazz'))
9
+
10
+ intro = File.join(JAZ_DIR, "intro.js")
11
+ outro = File.join(JAZ_DIR, "outro.js")
12
+
13
+ if $jazz_qunit
14
+ intro = File.join(JAZ_DIR, "qintro.js")
15
+ outro = File.join(JAZ_DIR, "qoutro.js")
16
+ end
17
+
18
+ args = [ "envjsrb" ]
19
+ if $jazz_deps
20
+ args += [ "--deps", $jazz_deps ]
21
+ end
22
+ args << intro
23
+
24
+ introd = true
25
+ outrod = true
26
+
27
+ ARGV.each do |f|
28
+
29
+ if f =~ /\.x?html?$/ || f =~ %r(^https?://)
30
+ if introd && !outrod
31
+ args << outro
32
+ args << "about:blank"
33
+ outrod = true
34
+ introd = false
35
+ end
36
+ if !introd
37
+ args << intro
38
+ end
39
+ args << f
40
+ introd = true
41
+ outrod = false
42
+ elsif f == "about:blank"
43
+ if introd && !outrod
44
+ args << outro
45
+ outrod = true
46
+ introd = false
47
+ end
48
+ args << f
49
+ else
50
+ args << f
51
+ end
52
+
53
+ end
54
+
55
+ args << outro
56
+
57
+ cmd = args.join(" ")
58
+
59
+ puts cmd if $jazz_verbose
60
+
61
+ require 'eventmachine'
62
+ require 'nokogiri'
63
+
64
+ class Restart < Exception; end
65
+
66
+ def colour(text, colour_code)
67
+ # return text unless ENV['RSPEC_COLOR'] || (colour? & (autospec? || output_to_tty?))
68
+ "#{colour_code}#{text}\e[0m"
69
+ end
70
+
71
+ def green(text); colour(text, "\e[32m"); end
72
+ def red(text); colour(text, "\e[31m"); end
73
+ def yellow(text); colour(text, "\e[33m"); end
74
+ def blue(text); colour(text, "\e[34m"); end
75
+
76
+ $spec_info = {}
77
+ $spec_info[:specs] = []
78
+ $spec_info[:failures] = []
79
+ $spec_info[:pending] = []
80
+
81
+ class SAX < Nokogiri::XML::SAX::Document
82
+
83
+ def start_element name, attrs
84
+ # p attrs
85
+ attrs = Hash[*attrs]
86
+ # p attrs
87
+ case name
88
+ when "testsuites";
89
+ when "testsuite";
90
+ @testsuite_name = attrs["name"]
91
+ if @testsuite_pending = ( attrs["skipped"] == "true" )
92
+ $spec_info[:specs] << (tc = {})
93
+ tc[:name] = @testsuite_name
94
+ $spec_info[:pending] << $spec_info[:specs].last
95
+ end
96
+ when "testcase";
97
+ $spec_info[:specs] << (tc = {})
98
+ tc[:name] = @testsuite_name + " : " + attrs["name"]
99
+ @testcase_failed = false
100
+ when "failure";
101
+ $spec_info[:failures] << (tc = $spec_info[:specs].last)
102
+ tc[:message] = attrs["message"]
103
+ @testcase_failed = true
104
+ else; raise "hell: #{name}"
105
+ end
106
+ end
107
+
108
+ def cdata_block string
109
+ if @testcase_failed
110
+ $spec_info[:failures].last[:stack] ||= ""
111
+ $spec_info[:failures].last[:stack] << string
112
+ end
113
+ end
114
+
115
+ def end_element name
116
+ case name
117
+ when "testsuites";
118
+ raise Restart
119
+ when "testsuite";
120
+ if !$jazz_xml
121
+ if @testsuite_pending
122
+ char = yellow("*")
123
+ print char
124
+ $stdout.flush
125
+ end
126
+ end
127
+ when "testcase";
128
+ if !$jazz_xml
129
+ char = nil
130
+ if @testcase_failed
131
+ char = red("F")
132
+ else
133
+ char = green(".")
134
+ end
135
+ print char
136
+ $stdout.flush
137
+ end
138
+ when "failure";
139
+ else; raise "hell: #{name}"
140
+ end
141
+ end
142
+ end
143
+
144
+ $failed_processes = 0
145
+
146
+ module WriteToNokogiri
147
+ def post_init
148
+ @parser = Nokogiri::XML::SAX::PushParser.new( SAX.new )
149
+ end
150
+ def receive_data data
151
+ begin
152
+ if $jazz_xml
153
+ # $stderr.print data
154
+ puts data
155
+ $stdout.flush
156
+ end
157
+ @parser << data
158
+ rescue Restart
159
+ @parser = Nokogiri::XML::SAX::PushParser.new( SAX.new )
160
+ rescue Exception => e
161
+ $stderr.puts "Parser raised #{e} on #{data}"
162
+ exit 1
163
+ end
164
+ end
165
+ def unbind
166
+ $failed_processes += 1 if get_status.exitstatus &&
167
+ get_status.exitstatus > 0
168
+ EM.stop
169
+ end
170
+ end
171
+
172
+ date = Time.now
173
+ failures = nil
174
+ examples = nil
175
+ pending = nil
176
+
177
+ EM.run do
178
+ EM.popen cmd, WriteToNokogiri
179
+ end
180
+
181
+ puts
182
+ puts
183
+
184
+ if !$jazz_xml
185
+ if $spec_info[:pending].length > 0
186
+ puts "Pending:"
187
+ $spec_info[:pending].each do |pending|
188
+ puts
189
+ puts yellow(pending[:name])
190
+ end
191
+ puts "\n"
192
+ end
193
+ $spec_info[:failures].each_with_index do |failure,i|
194
+ print i+1,")\n"
195
+ print red("#{failure[:name]} FAILED\n")
196
+ print red(failure[:message]),"\n"
197
+ # double check, but is there really anything in the jaz stack that's useful?
198
+ stack = failure[:stack]
199
+ stack and ( stack = stack.split "\n" )
200
+ stack and stack.each do |line|
201
+ if line =~ %r(/jasmine.js:\d+) || line =~ %r(/jasmine/src/.*\.js:\d+)
202
+ break
203
+ end
204
+ print line, "\n"
205
+ end
206
+ # p stack
207
+ # print failure[:stack],"\n"
208
+ end
209
+ puts "Finished in #{Time.now - date} seconds"
210
+ puts
211
+ examples = $spec_info[:specs].length
212
+ # require 'pp'
213
+ # pp $spec_info[:specs]
214
+ failures = $spec_info[:failures].length
215
+ pending = $spec_info[:pending].length
216
+ if $failed_processes > 0
217
+ examples += $failed_processes
218
+ failures += $failed_processes
219
+ end
220
+ msg = "#{examples} examples, #{failures} failures, #{pending} pending"
221
+ if failures > 0
222
+ msg = red(msg)
223
+ elsif pending > 0
224
+ msg = yellow(msg)
225
+ else
226
+ msg = green(msg)
227
+ end
228
+ puts msg
229
+ end
230
+ exit ( !failures.nil? && failures > 0 ) ? 1 : 0
@@ -0,0 +1,460 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"" />
6
+
7
+ <title>JsDoc Reference - File Index</title>
8
+ <meta name="generator" content="JsDoc Toolkit" />
9
+
10
+ <style type="text/css">
11
+ /* default.css */
12
+ body
13
+ {
14
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
+ width: 800px;
16
+ }
17
+
18
+ .header
19
+ {
20
+ clear: both;
21
+ background-color: #ccc;
22
+ padding: 8px;
23
+ }
24
+
25
+ h1
26
+ {
27
+ font-size: 150%;
28
+ font-weight: bold;
29
+ padding: 0;
30
+ margin: 1em 0 0 .3em;
31
+ }
32
+
33
+ hr
34
+ {
35
+ border: none 0;
36
+ border-top: 1px solid #7F8FB1;
37
+ height: 1px;
38
+ }
39
+
40
+ pre.code
41
+ {
42
+ display: block;
43
+ padding: 8px;
44
+ border: 1px dashed #ccc;
45
+ }
46
+
47
+ #index
48
+ {
49
+ margin-top: 24px;
50
+ float: left;
51
+ width: 160px;
52
+ position: absolute;
53
+ left: 8px;
54
+ background-color: #F3F3F3;
55
+ padding: 8px;
56
+ }
57
+
58
+ #content
59
+ {
60
+ margin-left: 190px;
61
+ width: 600px;
62
+ }
63
+
64
+ .classList
65
+ {
66
+ list-style-type: none;
67
+ padding: 0;
68
+ margin: 0 0 0 8px;
69
+ font-family: arial, sans-serif;
70
+ font-size: 1em;
71
+ overflow: auto;
72
+ }
73
+
74
+ .classList li
75
+ {
76
+ padding: 0;
77
+ margin: 0 0 8px 0;
78
+ }
79
+
80
+ .summaryTable { width: 100%; }
81
+
82
+ h1.classTitle
83
+ {
84
+ font-size:170%;
85
+ line-height:130%;
86
+ }
87
+
88
+ h2 { font-size: 110%; }
89
+ caption, div.sectionTitle
90
+ {
91
+ background-color: #7F8FB1;
92
+ color: #fff;
93
+ font-size:130%;
94
+ text-align: left;
95
+ padding: 2px 6px 2px 6px;
96
+ border: 1px #7F8FB1 solid;
97
+ }
98
+
99
+ div.sectionTitle { margin-bottom: 8px; }
100
+ .summaryTable thead { display: none; }
101
+
102
+ .summaryTable td
103
+ {
104
+ vertical-align: top;
105
+ padding: 4px;
106
+ border-bottom: 1px #7F8FB1 solid;
107
+ border-right: 1px #7F8FB1 solid;
108
+ }
109
+
110
+ /*col#summaryAttributes {}*/
111
+ .summaryTable td.attributes
112
+ {
113
+ border-left: 1px #7F8FB1 solid;
114
+ width: 140px;
115
+ text-align: right;
116
+ }
117
+
118
+ td.attributes, .fixedFont
119
+ {
120
+ line-height: 15px;
121
+ color: #002EBE;
122
+ font-family: "Courier New",Courier,monospace;
123
+ font-size: 13px;
124
+ }
125
+
126
+ .summaryTable td.nameDescription
127
+ {
128
+ text-align: left;
129
+ font-size: 13px;
130
+ line-height: 15px;
131
+ }
132
+
133
+ .summaryTable td.nameDescription, .description
134
+ {
135
+ line-height: 15px;
136
+ padding: 4px;
137
+ padding-left: 4px;
138
+ }
139
+
140
+ .summaryTable { margin-bottom: 8px; }
141
+
142
+ ul.inheritsList
143
+ {
144
+ list-style: square;
145
+ margin-left: 20px;
146
+ padding-left: 0;
147
+ }
148
+
149
+ .detailList {
150
+ margin-left: 20px;
151
+ line-height: 15px;
152
+ }
153
+ .detailList dt { margin-left: 20px; }
154
+
155
+ .detailList .heading
156
+ {
157
+ font-weight: bold;
158
+ padding-bottom: 6px;
159
+ margin-left: 0;
160
+ }
161
+
162
+ .light, td.attributes, .light a:link, .light a:visited
163
+ {
164
+ color: #777;
165
+ font-style: italic;
166
+ }
167
+
168
+ .fineprint
169
+ {
170
+ text-align: right;
171
+ font-size: 10px;
172
+ }
173
+ </style>
174
+ </head>
175
+
176
+ <body>
177
+ <div id="header">
178
+ </div>
179
+
180
+ <div id="index">
181
+ <div align="center"><a href="index.html">Class Index</a>
182
+ | <a href="files.html">File Index</a></div>
183
+ <hr />
184
+ <h2>Classes</h2>
185
+ <ul class="classList">
186
+
187
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
188
+
189
+ <li><a href="symbols/jasmine.html">jasmine</a></li>
190
+
191
+ <li><a href="symbols/jasmine.Block.html">jasmine.Block</a></li>
192
+
193
+ <li><a href="symbols/jasmine.Clock.html">jasmine.Clock</a></li>
194
+
195
+ <li><a href="symbols/jasmine.Env.html">jasmine.Env</a></li>
196
+
197
+ <li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
198
+
199
+ <li><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
200
+
201
+ <li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
202
+
203
+ <li><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
204
+
205
+ <li><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
206
+
207
+ <li><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></li>
208
+
209
+ <li><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></li>
210
+
211
+ <li><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></li>
212
+
213
+ <li><a href="symbols/jasmine.Suite.html">jasmine.Suite</a></li>
214
+
215
+ <li><a href="symbols/jasmine.util.html">jasmine.util</a></li>
216
+
217
+ </ul>
218
+ <hr />
219
+ </div>
220
+
221
+ <div id="content">
222
+ <h1 class="classTitle">File Index</h1>
223
+
224
+
225
+ <div>
226
+ <h2><a href="symbols/src/lib_TrivialReporter.js.html">lib/TrivialReporter.js</a></h2>
227
+
228
+ <dl>
229
+
230
+
231
+
232
+
233
+ </dl>
234
+ </div>
235
+ <hr />
236
+
237
+ <div>
238
+ <h2><a href="symbols/src/src_base.js.html">src/base.js</a></h2>
239
+
240
+ <dl>
241
+
242
+
243
+
244
+
245
+ </dl>
246
+ </div>
247
+ <hr />
248
+
249
+ <div>
250
+ <h2><a href="symbols/src/src_Block.js.html">src/Block.js</a></h2>
251
+
252
+ <dl>
253
+
254
+
255
+
256
+
257
+ </dl>
258
+ </div>
259
+ <hr />
260
+
261
+ <div>
262
+ <h2><a href="symbols/src/src_Env.js.html">src/Env.js</a></h2>
263
+
264
+ <dl>
265
+
266
+
267
+
268
+
269
+ </dl>
270
+ </div>
271
+ <hr />
272
+
273
+ <div>
274
+ <h2><a href="symbols/src/src_JsApiReporter.js.html">src/JsApiReporter.js</a></h2>
275
+
276
+ <dl>
277
+
278
+
279
+
280
+
281
+ </dl>
282
+ </div>
283
+ <hr />
284
+
285
+ <div>
286
+ <h2><a href="symbols/src/src_Matchers.js.html">src/Matchers.js</a></h2>
287
+
288
+ <dl>
289
+
290
+
291
+
292
+
293
+ </dl>
294
+ </div>
295
+ <hr />
296
+
297
+ <div>
298
+ <h2><a href="symbols/src/src_mock-timeout.js.html">src/mock-timeout.js</a></h2>
299
+
300
+ <dl>
301
+
302
+
303
+
304
+
305
+ </dl>
306
+ </div>
307
+ <hr />
308
+
309
+ <div>
310
+ <h2><a href="symbols/src/src_MultiReporter.js.html">src/MultiReporter.js</a></h2>
311
+
312
+ <dl>
313
+
314
+
315
+
316
+
317
+ </dl>
318
+ </div>
319
+ <hr />
320
+
321
+ <div>
322
+ <h2><a href="symbols/src/src_NestedResults.js.html">src/NestedResults.js</a></h2>
323
+
324
+ <dl>
325
+
326
+
327
+
328
+
329
+ </dl>
330
+ </div>
331
+ <hr />
332
+
333
+ <div>
334
+ <h2><a href="symbols/src/src_PrettyPrinter.js.html">src/PrettyPrinter.js</a></h2>
335
+
336
+ <dl>
337
+
338
+
339
+
340
+
341
+ </dl>
342
+ </div>
343
+ <hr />
344
+
345
+ <div>
346
+ <h2><a href="symbols/src/src_Queue.js.html">src/Queue.js</a></h2>
347
+
348
+ <dl>
349
+
350
+
351
+
352
+
353
+ </dl>
354
+ </div>
355
+ <hr />
356
+
357
+ <div>
358
+ <h2><a href="symbols/src/src_Reporter.js.html">src/Reporter.js</a></h2>
359
+
360
+ <dl>
361
+
362
+
363
+
364
+
365
+ </dl>
366
+ </div>
367
+ <hr />
368
+
369
+ <div>
370
+ <h2><a href="symbols/src/src_Reporters.js.html">src/Reporters.js</a></h2>
371
+
372
+ <dl>
373
+
374
+
375
+
376
+
377
+ </dl>
378
+ </div>
379
+ <hr />
380
+
381
+ <div>
382
+ <h2><a href="symbols/src/src_Runner.js.html">src/Runner.js</a></h2>
383
+
384
+ <dl>
385
+
386
+
387
+
388
+
389
+ </dl>
390
+ </div>
391
+ <hr />
392
+
393
+ <div>
394
+ <h2><a href="symbols/src/src_Spec.js.html">src/Spec.js</a></h2>
395
+
396
+ <dl>
397
+
398
+
399
+
400
+
401
+ </dl>
402
+ </div>
403
+ <hr />
404
+
405
+ <div>
406
+ <h2><a href="symbols/src/src_Suite.js.html">src/Suite.js</a></h2>
407
+
408
+ <dl>
409
+
410
+
411
+
412
+
413
+ </dl>
414
+ </div>
415
+ <hr />
416
+
417
+ <div>
418
+ <h2><a href="symbols/src/src_util.js.html">src/util.js</a></h2>
419
+
420
+ <dl>
421
+
422
+
423
+
424
+
425
+ </dl>
426
+ </div>
427
+ <hr />
428
+
429
+ <div>
430
+ <h2><a href="symbols/src/src_WaitsBlock.js.html">src/WaitsBlock.js</a></h2>
431
+
432
+ <dl>
433
+
434
+
435
+
436
+
437
+ </dl>
438
+ </div>
439
+ <hr />
440
+
441
+ <div>
442
+ <h2><a href="symbols/src/src_WaitsForBlock.js.html">src/WaitsForBlock.js</a></h2>
443
+
444
+ <dl>
445
+
446
+
447
+
448
+
449
+ </dl>
450
+ </div>
451
+ <hr />
452
+
453
+
454
+ </div>
455
+ <div class="fineprint" style="clear:both">
456
+
457
+ Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Nov 24 2009 15:21:26 GMT-0800 (PST)
458
+ </div>
459
+ </body>
460
+ </html>