qunited 0.0.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.
- data/.gitignore +13 -0
- data/Gemfile +4 -0
- data/Rakefile +9 -0
- data/bin/qunited +23 -0
- data/lib/qunited/js_runner/base.rb +34 -0
- data/lib/qunited/js_runner/rhino/js/env.rhino.js +14006 -0
- data/lib/qunited/js_runner/rhino/js/js.jar +0 -0
- data/lib/qunited/js_runner/rhino/js/qunit-runner.js +168 -0
- data/lib/qunited/js_runner/rhino/js/qunit.js +1838 -0
- data/lib/qunited/js_runner/rhino/js/yaml.js +22 -0
- data/lib/qunited/js_runner/rhino.rb +65 -0
- data/lib/qunited/js_runner.rb +2 -0
- data/lib/qunited/rake_task.rb +87 -0
- data/lib/qunited/results.rb +164 -0
- data/lib/qunited/runner.rb +23 -0
- data/lib/qunited/version.rb +3 -0
- data/lib/qunited.rb +4 -0
- data/qunited.gemspec +20 -0
- data/test/fixtures/basic_project/app/assets/javascripts/application.js +6 -0
- data/test/fixtures/basic_project/test/javascripts/test_basics.js +6 -0
- data/test/fixtures/basic_project/test/javascripts/test_math.js +12 -0
- data/test/fixtures/dom_project/app/assets/javascripts/application.js +6 -0
- data/test/fixtures/dom_project/test/javascripts/test_misc.js +5 -0
- data/test/fixtures/errors_project/app/assets/javascripts/no_error.js +5 -0
- data/test/fixtures/errors_project/app/assets/javascripts/syntax_error.js +7 -0
- data/test/fixtures/errors_project/app/assets/javascripts/undefined_error.js +9 -0
- data/test/fixtures/errors_project/test/javascripts/this_test_has_no_errors_in_it.js +5 -0
- data/test/fixtures/errors_project/test/javascripts/this_test_has_no_tests.js +4 -0
- data/test/fixtures/errors_project/test/javascripts/this_test_has_syntax_error.js +10 -0
- data/test/fixtures/errors_project/test/javascripts/this_test_has_undefined_error.js +10 -0
- data/test/fixtures/failures_project/app/assets/javascripts/application.js +5 -0
- data/test/fixtures/failures_project/test/javascripts/test_basics.js +11 -0
- data/test/fixtures/failures_project/test/javascripts/test_math.js +12 -0
- data/test/test_helper.rb +5 -0
- data/test/unit/test_results.rb +338 -0
- data/test/unit/test_rhino_runner.rb +114 -0
- metadata +100 -0
@@ -0,0 +1,338 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
|
3
|
+
class TestResults < MiniTest::Unit::TestCase
|
4
|
+
|
5
|
+
def test_gives_you_various_counts
|
6
|
+
results = QUnited::Results.new test_module_results
|
7
|
+
assert results.passed?, 'passed? is true when all tests have passed'
|
8
|
+
assert !results.failed?, 'failed? is false when all tests have passed'
|
9
|
+
assert_equal 3, results.total_tests, 'total_tests gives total tests count'
|
10
|
+
assert_equal 4, results.total_assertions, 'total_assertions gives total assertions count'
|
11
|
+
assert_equal 0, results.total_failures, 'total_failures gives total failures count when there are none'
|
12
|
+
assert_equal 0, results.total_errors, 'total_errors gives total errors when there are none'
|
13
|
+
|
14
|
+
other_results = QUnited::Results.new test_failed_module_results
|
15
|
+
|
16
|
+
assert !other_results.passed?, 'passed? is false when there are failures'
|
17
|
+
assert other_results.failed?, 'failed? is true when there are failures'
|
18
|
+
assert_equal 4, other_results.total_tests, 'total_tests gives total tests count'
|
19
|
+
assert_equal 5 + 1, other_results.total_assertions, 'total_assertions gives total assertions count'
|
20
|
+
assert_equal 4, other_results.total_failures, 'total_failures gives total failures count when there are some'
|
21
|
+
assert_equal 0, results.total_errors, 'total_errors gives total errors when there are none'
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_basic_output
|
25
|
+
results = QUnited::Results.new test_module_results
|
26
|
+
assert_equal "3 tests, 4 assertions, 0 failures, 0 errors, 0 skips", results.bottom_line
|
27
|
+
assert_equal "...", results.dots
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_failures_output
|
31
|
+
results = QUnited::Results.new test_failed_module_results
|
32
|
+
|
33
|
+
assert_equal "4 tests, 6 assertions, 4 failures, 0 errors, 0 skips", results.bottom_line
|
34
|
+
assert_equal "F.FF", results.dots
|
35
|
+
|
36
|
+
failure = results.failures_output_array[0].split("\n")
|
37
|
+
assert_equal 3, failure.size
|
38
|
+
assert_equal ' 1) Failure:', failure[0]
|
39
|
+
assert_equal 'This has one failure (Basics) [test/javascripts/test_basics.js]', failure[1]
|
40
|
+
assert_equal 'Failed assertion, no message given.', failure[2]
|
41
|
+
|
42
|
+
failure = results.failures_output_array[1].split("\n")
|
43
|
+
assert_equal 5, failure.size
|
44
|
+
assert_equal ' 2) Failure:', failure[0]
|
45
|
+
assert_equal 'Addition is hard (Math) [test/javascripts/test_math.js]', failure[1]
|
46
|
+
assert_equal 'I got my math right', failure[2]
|
47
|
+
assert_equal 'Expected: 3', failure[3]
|
48
|
+
assert_equal ' Actual: 2', failure[4]
|
49
|
+
|
50
|
+
failure = results.failures_output_array[2].split("\n")
|
51
|
+
assert_equal 5, failure.size
|
52
|
+
assert_equal ' 3) Failure:', failure[0]
|
53
|
+
assert_equal 'Addition is hard (Math) [test/javascripts/test_math.js]', failure[1]
|
54
|
+
assert_equal 'These strings match', failure[2]
|
55
|
+
assert_equal 'Expected: "String here"', failure[3]
|
56
|
+
assert_equal ' Actual: "Identical string here"', failure[4]
|
57
|
+
|
58
|
+
failure = results.failures_output_array[3].split("\n")
|
59
|
+
assert_equal 3, failure.size
|
60
|
+
assert_equal ' 4) Failure:', failure[0]
|
61
|
+
assert_equal 'Check some subtraction (Math) [test/javascripts/test_math.js]', failure[1]
|
62
|
+
assert_equal 'Expected 2 assertions, but 1 were run', failure[2]
|
63
|
+
end
|
64
|
+
|
65
|
+
# Test results are converted to JavaScript appropriate null, not nil
|
66
|
+
def test_null_failures_output
|
67
|
+
results = QUnited::Results.new test_failed_module_results_with_null
|
68
|
+
|
69
|
+
failure = results.failures_output_array[0].split("\n")
|
70
|
+
assert_equal 5, failure.size
|
71
|
+
assert_equal ' 1) Failure:', failure[0]
|
72
|
+
assert_equal 'The test (The module) [test/javascripts/test_module.js]', failure[1]
|
73
|
+
assert_equal 'Was it null?', failure[2]
|
74
|
+
assert_equal 'Expected: 5', failure[3]
|
75
|
+
assert_equal ' Actual: null', failure[4]
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_errors_and_error_output
|
79
|
+
results = QUnited::Results.new test_failed_module_results_with_an_error
|
80
|
+
|
81
|
+
assert results.failed?, 'failed? is true when there are errors'
|
82
|
+
assert_equal 2, results.total_tests, 'total_tests gives total tests count'
|
83
|
+
assert_equal 3, results.total_assertions, 'total_assertions gives total assertions count'
|
84
|
+
assert_equal 0, results.total_failures, 'total_failures gives total failures count when there are none'
|
85
|
+
assert_equal 1, results.total_errors, 'total_errors gives total errors when there are none'
|
86
|
+
|
87
|
+
error = results.failures_output_array[0].split("\n")
|
88
|
+
assert_equal 3, error.size
|
89
|
+
assert_equal ' 1) Error:', error[0]
|
90
|
+
assert_equal 'Error test (The module) [test/javascripts/test_module.js]', error[1]
|
91
|
+
assert_equal 'Died on test #3: asdf is undefined', error[2]
|
92
|
+
|
93
|
+
assert_equal "2 tests, 3 assertions, 0 failures, 1 errors, 0 skips", results.bottom_line
|
94
|
+
assert_equal "E.", results.dots
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def test_module_results
|
100
|
+
[
|
101
|
+
{
|
102
|
+
:name => "(no module)",
|
103
|
+
:tests => [
|
104
|
+
{ :name => "The source code was loaded",
|
105
|
+
:failures => [],
|
106
|
+
:start => DateTime.parse('2012-06-12T23:52:33+00:00'),
|
107
|
+
:assertions => 1,
|
108
|
+
:duration => 0.002,
|
109
|
+
:failed => 0,
|
110
|
+
:total => 1,
|
111
|
+
:file => 'test/javascripts/test_basics.js',
|
112
|
+
:assertion_data => [
|
113
|
+
{ :result => true,
|
114
|
+
:message => "We have loaded it",
|
115
|
+
:actual => 1,
|
116
|
+
:expected => 1
|
117
|
+
}
|
118
|
+
]
|
119
|
+
}
|
120
|
+
]
|
121
|
+
},
|
122
|
+
{ :name => "Math",
|
123
|
+
:tests =>[
|
124
|
+
{
|
125
|
+
:name => "Addition works",
|
126
|
+
:failures => [],
|
127
|
+
:start => DateTime.parse('2012-06-12T23:52:33+00:00'),
|
128
|
+
:assertions => 2,
|
129
|
+
:duration => 0.01,
|
130
|
+
:failed => 0,
|
131
|
+
:total => 2,
|
132
|
+
:file => 'test/javascripts/test_math.js',
|
133
|
+
:assertion_data => [
|
134
|
+
{
|
135
|
+
:result => true,
|
136
|
+
:message => "One plus one does equal two",
|
137
|
+
:actual => 2,
|
138
|
+
:expected => 2
|
139
|
+
},
|
140
|
+
{
|
141
|
+
:result => true,
|
142
|
+
:message => "Two plus two does equal four",
|
143
|
+
:actual => 4,
|
144
|
+
:expected => 4
|
145
|
+
}
|
146
|
+
]
|
147
|
+
},
|
148
|
+
{ :name => "Subtraction works",
|
149
|
+
:failures => [],
|
150
|
+
:start => DateTime.parse('2012-06-12T23:52:33+00:00'),
|
151
|
+
:assertions => 1,
|
152
|
+
:duration => 0.009,
|
153
|
+
:failed => 0,
|
154
|
+
:total => 1,
|
155
|
+
:file => 'test/javascripts/test_math.js',
|
156
|
+
:assertion_data => [
|
157
|
+
{
|
158
|
+
:result=>true,
|
159
|
+
:message=>"Two minus one equals one",
|
160
|
+
:actual=>1,
|
161
|
+
:expected=>1
|
162
|
+
}
|
163
|
+
]
|
164
|
+
}
|
165
|
+
]
|
166
|
+
}
|
167
|
+
]
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_failed_module_results
|
171
|
+
[
|
172
|
+
{
|
173
|
+
:name => "Basics",
|
174
|
+
:tests => [
|
175
|
+
{
|
176
|
+
:name => "This has one failure",
|
177
|
+
:assertion_data => [
|
178
|
+
{
|
179
|
+
:result => false,
|
180
|
+
:message => nil
|
181
|
+
}
|
182
|
+
],
|
183
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
184
|
+
:assertions => 1,
|
185
|
+
:file => "test/javascripts/test_basics.js",
|
186
|
+
:duration => 0.002,
|
187
|
+
:failed => 1,
|
188
|
+
:total => 1
|
189
|
+
},
|
190
|
+
{
|
191
|
+
:name => "This has no failures",
|
192
|
+
:assertion_data => [
|
193
|
+
{
|
194
|
+
:result => true,
|
195
|
+
:message => "It is 1",
|
196
|
+
:actual => 1,
|
197
|
+
:expected => 1
|
198
|
+
}
|
199
|
+
],
|
200
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
201
|
+
:assertions => 1,
|
202
|
+
:file => "test/javascripts/test_basics.js",
|
203
|
+
:duration => 0.006,
|
204
|
+
:failed => 0,
|
205
|
+
:total => 1
|
206
|
+
}
|
207
|
+
]
|
208
|
+
},
|
209
|
+
{
|
210
|
+
:name => "Math",
|
211
|
+
:tests => [
|
212
|
+
{
|
213
|
+
:name => "Addition is hard",
|
214
|
+
:assertion_data => [
|
215
|
+
{
|
216
|
+
:result => false,
|
217
|
+
:message => "I got my math right",
|
218
|
+
:actual => 2,
|
219
|
+
:expected => 3
|
220
|
+
},
|
221
|
+
{
|
222
|
+
:result => false,
|
223
|
+
:message => "These strings match",
|
224
|
+
:actual => "Identical string here",
|
225
|
+
:expected => "String here"
|
226
|
+
}
|
227
|
+
],
|
228
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
229
|
+
:assertions => 2,
|
230
|
+
:file => "test/javascripts/test_math.js",
|
231
|
+
:duration => 0.02,
|
232
|
+
:failed => 2,
|
233
|
+
:total => 2
|
234
|
+
},
|
235
|
+
{
|
236
|
+
:name => "Check some subtraction",
|
237
|
+
:assertion_data => [
|
238
|
+
{
|
239
|
+
:result => true,
|
240
|
+
:message => "Two minus one equals one",
|
241
|
+
:actual => 1,
|
242
|
+
:expected => 1
|
243
|
+
},
|
244
|
+
{
|
245
|
+
:result => false,
|
246
|
+
:message => "Expected 2 assertions, but 1 were run"
|
247
|
+
}
|
248
|
+
],
|
249
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
250
|
+
:assertions => 2,
|
251
|
+
:file => "test/javascripts/test_math.js",
|
252
|
+
:duration => 0.008,
|
253
|
+
:failed => 1,
|
254
|
+
:total => 2
|
255
|
+
}
|
256
|
+
]
|
257
|
+
}
|
258
|
+
]
|
259
|
+
end
|
260
|
+
|
261
|
+
def test_failed_module_results_with_null
|
262
|
+
[
|
263
|
+
{
|
264
|
+
:name => "The module",
|
265
|
+
:tests => [
|
266
|
+
{
|
267
|
+
:name => "The test",
|
268
|
+
:assertion_data => [
|
269
|
+
{
|
270
|
+
:result => false,
|
271
|
+
:message => "Was it null?",
|
272
|
+
:actual => nil,
|
273
|
+
:expected => 5
|
274
|
+
}
|
275
|
+
],
|
276
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
277
|
+
:assertions => 1,
|
278
|
+
:file => "test/javascripts/test_module.js",
|
279
|
+
:duration => 0.002,
|
280
|
+
:failed => 1,
|
281
|
+
:total => 1
|
282
|
+
}
|
283
|
+
]
|
284
|
+
}
|
285
|
+
]
|
286
|
+
end
|
287
|
+
|
288
|
+
def test_failed_module_results_with_an_error
|
289
|
+
[
|
290
|
+
{
|
291
|
+
:name => "The module",
|
292
|
+
:tests => [
|
293
|
+
{
|
294
|
+
:name => "Error test",
|
295
|
+
:assertion_data => [
|
296
|
+
{
|
297
|
+
:result => true,
|
298
|
+
:message => "This one fine",
|
299
|
+
:actual => "String",
|
300
|
+
:expected => "String"
|
301
|
+
},
|
302
|
+
{
|
303
|
+
:result => false,
|
304
|
+
:message => "Died on test #3: asdf is undefined"
|
305
|
+
}
|
306
|
+
|
307
|
+
],
|
308
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
309
|
+
:assertions => 2,
|
310
|
+
:file => "test/javascripts/test_module.js",
|
311
|
+
:duration => 0.002,
|
312
|
+
:failed => 1,
|
313
|
+
:total => 2
|
314
|
+
},
|
315
|
+
{
|
316
|
+
:name => "OK test",
|
317
|
+
:assertion_data => [
|
318
|
+
{
|
319
|
+
:result => true,
|
320
|
+
:message => "All good",
|
321
|
+
:actual => 5,
|
322
|
+
:expected => 5
|
323
|
+
}
|
324
|
+
|
325
|
+
],
|
326
|
+
:start => DateTime.parse('2012-06-14T13:24:11+00:00'),
|
327
|
+
:assertions => 1,
|
328
|
+
:file => "test/javascripts/test_module.js",
|
329
|
+
:duration => 0.002,
|
330
|
+
:failed => 0,
|
331
|
+
:total => 1
|
332
|
+
}
|
333
|
+
]
|
334
|
+
}
|
335
|
+
]
|
336
|
+
end
|
337
|
+
|
338
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
require 'stringio'
|
3
|
+
|
4
|
+
# Test running tests with the Rhino test runner. These
|
5
|
+
# are really more integration tests than unit tests.
|
6
|
+
class TestRhinoRunner < MiniTest::Unit::TestCase
|
7
|
+
|
8
|
+
def test_running_basic_tests
|
9
|
+
results = runner_for_project('basic_project').run.results
|
10
|
+
assert_equal 3, results.total_tests, 'Correct number of tests run'
|
11
|
+
assert_equal 4, results.total_assertions, 'Correct number of assertions executed'
|
12
|
+
assert_equal 0, results.total_failures, 'Correct number of failures given'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Make sure we can run tests with DOM operations
|
16
|
+
def test_running_dom_tests
|
17
|
+
results = runner_for_project('dom_project').run.results
|
18
|
+
assert_equal 1, results.total_tests, 'Correct number of tests run'
|
19
|
+
assert_equal 2, results.total_assertions, 'Correct number of assertions executed'
|
20
|
+
assert_equal 0, results.total_failures, 'Correct number of failures given'
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_failures_are_recorded_correctly
|
24
|
+
results = runner_for_project('failures_project').run.results
|
25
|
+
assert_equal 4, results.total_tests, 'Correct number of tests run'
|
26
|
+
# QUnit calls the log callback (the same it calls for assertions) every time there
|
27
|
+
# is a failed expect(num). So add one to this total.
|
28
|
+
assert_equal 5 + 1, results.total_assertions, 'Correct number of assertions executed'
|
29
|
+
assert_equal 4, results.total_failures, 'Correct number of failures given'
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_undefined_error_in_source
|
33
|
+
runner = QUnited::JsRunner::Rhino.new(
|
34
|
+
[File.join(FIXTURES_DIR, 'errors_project/app/assets/javascripts/undefined_error.js')],
|
35
|
+
[File.join(FIXTURES_DIR, 'errors_project/test/javascripts/this_test_has_no_errors_in_it.js')])
|
36
|
+
|
37
|
+
stderr = capture_stderr { runner.run }
|
38
|
+
assert stderr.size > 10, 'Got some stderr output to describe the crash'
|
39
|
+
results = runner.results
|
40
|
+
assert results.passed?, 'Should succeed even if crash in source file as long as tests pass'
|
41
|
+
assert_equal 1, results.total_tests, 'Correct number of tests run'
|
42
|
+
assert_equal 1, results.total_assertions, 'Correct number of assertions executed'
|
43
|
+
assert_equal 0, results.total_failures, 'Correct number of failures given'
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_syntax_error_in_source
|
47
|
+
runner = QUnited::JsRunner::Rhino.new(
|
48
|
+
[File.join(FIXTURES_DIR, 'errors_project/app/assets/javascripts/syntax_error.js')],
|
49
|
+
[File.join(FIXTURES_DIR, 'errors_project/test/javascripts/this_test_has_no_errors_in_it.js')])
|
50
|
+
|
51
|
+
stderr = capture_stderr { runner.run }
|
52
|
+
assert stderr.size > 10, 'Got some stderr output to describe the crash'
|
53
|
+
results = runner.results
|
54
|
+
assert runner.results.passed?, 'Should succeed even if crash in source file as long as tests pass'
|
55
|
+
assert_equal 1, results.total_tests, 'Correct number of tests run'
|
56
|
+
assert_equal 1, results.total_assertions, 'Correct number of assertions executed'
|
57
|
+
assert_equal 0, results.total_failures, 'Correct number of failures given'
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_undefined_error_in_test
|
61
|
+
runner = QUnited::JsRunner::Rhino.new(
|
62
|
+
[File.join(FIXTURES_DIR, 'errors_project/app/assets/javascripts/no_error.js')],
|
63
|
+
[File.join(FIXTURES_DIR, 'errors_project/test/javascripts/this_test_has_undefined_error.js')])
|
64
|
+
|
65
|
+
stderr = capture_stderr { runner.run }
|
66
|
+
assert stderr.strip.empty?, 'No stderr if test crashes - should have been caught'
|
67
|
+
results = runner.results
|
68
|
+
assert results.failed?, 'We got a failure with the undefined error'
|
69
|
+
assert_equal 2, results.total_tests, 'Correct number of tests run'
|
70
|
+
# "assertions" count will actually be 1, plus the unefined error being recorded
|
71
|
+
assert_equal 2, results.total_assertions, 'Correct number of assertions executed'
|
72
|
+
assert_equal 0, results.total_failures, 'Correct number of failures given'
|
73
|
+
# The crashed test errors, but the other should be allowed to succeed
|
74
|
+
assert_equal 1, results.total_errors, 'Correct number of errors given'
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_syntax_error_in_test
|
78
|
+
runner = QUnited::JsRunner::Rhino.new(
|
79
|
+
[File.join(FIXTURES_DIR, 'errors_project/app/assets/javascripts/no_error.js')],
|
80
|
+
[File.join(FIXTURES_DIR, 'errors_project/test/javascripts/this_test_has_syntax_error.js'),
|
81
|
+
File.join(FIXTURES_DIR, 'errors_project/test/javascripts/this_test_has_no_errors_in_it.js')])
|
82
|
+
|
83
|
+
stderr = capture_stderr { runner.run }
|
84
|
+
assert stderr.size > 10, 'Got some stderr output to describe the crash'
|
85
|
+
results = runner.results
|
86
|
+
assert runner.results.failed?, 'Should fail if syntax error in test'
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_no_tests_in_test_file_means_failure
|
90
|
+
runner = QUnited::JsRunner::Rhino.new(
|
91
|
+
[File.join(FIXTURES_DIR, 'errors_project/app/assets/javascripts/no_error.js')],
|
92
|
+
[File.join(FIXTURES_DIR, 'errors_project/test/javascripts/this_test_has_no_tests.js')])
|
93
|
+
runner.run
|
94
|
+
|
95
|
+
results = runner.results
|
96
|
+
assert results.failed?, 'No tests in a file means failure'
|
97
|
+
end
|
98
|
+
|
99
|
+
private
|
100
|
+
|
101
|
+
def runner_for_project(project_name)
|
102
|
+
Dir.chdir File.join(FIXTURES_DIR, project_name)
|
103
|
+
QUnited::JsRunner::Rhino.new("app/assets/javascripts/*.js", "test/javascripts/*.js")
|
104
|
+
end
|
105
|
+
|
106
|
+
def capture_stderr
|
107
|
+
previous_stderr, $stderr = $stderr, StringIO.new
|
108
|
+
yield
|
109
|
+
$stderr.string
|
110
|
+
ensure
|
111
|
+
$stderr = previous_stderr
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: qunited
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aaron Royer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-30 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: QUnited runs headless QUnit tests as part of your normal build
|
15
|
+
email:
|
16
|
+
- aaronroyer@gmail.com
|
17
|
+
executables:
|
18
|
+
- qunited
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- Rakefile
|
25
|
+
- bin/qunited
|
26
|
+
- lib/qunited.rb
|
27
|
+
- lib/qunited/js_runner.rb
|
28
|
+
- lib/qunited/js_runner/base.rb
|
29
|
+
- lib/qunited/js_runner/rhino.rb
|
30
|
+
- lib/qunited/js_runner/rhino/js/env.rhino.js
|
31
|
+
- lib/qunited/js_runner/rhino/js/js.jar
|
32
|
+
- lib/qunited/js_runner/rhino/js/qunit-runner.js
|
33
|
+
- lib/qunited/js_runner/rhino/js/qunit.js
|
34
|
+
- lib/qunited/js_runner/rhino/js/yaml.js
|
35
|
+
- lib/qunited/rake_task.rb
|
36
|
+
- lib/qunited/results.rb
|
37
|
+
- lib/qunited/runner.rb
|
38
|
+
- lib/qunited/version.rb
|
39
|
+
- qunited.gemspec
|
40
|
+
- test/fixtures/basic_project/app/assets/javascripts/application.js
|
41
|
+
- test/fixtures/basic_project/test/javascripts/test_basics.js
|
42
|
+
- test/fixtures/basic_project/test/javascripts/test_math.js
|
43
|
+
- test/fixtures/dom_project/app/assets/javascripts/application.js
|
44
|
+
- test/fixtures/dom_project/test/javascripts/test_misc.js
|
45
|
+
- test/fixtures/errors_project/app/assets/javascripts/no_error.js
|
46
|
+
- test/fixtures/errors_project/app/assets/javascripts/syntax_error.js
|
47
|
+
- test/fixtures/errors_project/app/assets/javascripts/undefined_error.js
|
48
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_no_errors_in_it.js
|
49
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_no_tests.js
|
50
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_syntax_error.js
|
51
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_undefined_error.js
|
52
|
+
- test/fixtures/failures_project/app/assets/javascripts/application.js
|
53
|
+
- test/fixtures/failures_project/test/javascripts/test_basics.js
|
54
|
+
- test/fixtures/failures_project/test/javascripts/test_math.js
|
55
|
+
- test/test_helper.rb
|
56
|
+
- test/unit/test_results.rb
|
57
|
+
- test/unit/test_rhino_runner.rb
|
58
|
+
homepage: https://github.com/aaronroyer/qunited
|
59
|
+
licenses: []
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project: qunited
|
78
|
+
rubygems_version: 1.8.11
|
79
|
+
signing_key:
|
80
|
+
specification_version: 3
|
81
|
+
summary: QUnit tests in your build
|
82
|
+
test_files:
|
83
|
+
- test/fixtures/basic_project/app/assets/javascripts/application.js
|
84
|
+
- test/fixtures/basic_project/test/javascripts/test_basics.js
|
85
|
+
- test/fixtures/basic_project/test/javascripts/test_math.js
|
86
|
+
- test/fixtures/dom_project/app/assets/javascripts/application.js
|
87
|
+
- test/fixtures/dom_project/test/javascripts/test_misc.js
|
88
|
+
- test/fixtures/errors_project/app/assets/javascripts/no_error.js
|
89
|
+
- test/fixtures/errors_project/app/assets/javascripts/syntax_error.js
|
90
|
+
- test/fixtures/errors_project/app/assets/javascripts/undefined_error.js
|
91
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_no_errors_in_it.js
|
92
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_no_tests.js
|
93
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_syntax_error.js
|
94
|
+
- test/fixtures/errors_project/test/javascripts/this_test_has_undefined_error.js
|
95
|
+
- test/fixtures/failures_project/app/assets/javascripts/application.js
|
96
|
+
- test/fixtures/failures_project/test/javascripts/test_basics.js
|
97
|
+
- test/fixtures/failures_project/test/javascripts/test_math.js
|
98
|
+
- test/test_helper.rb
|
99
|
+
- test/unit/test_results.rb
|
100
|
+
- test/unit/test_rhino_runner.rb
|