test-unit 3.1.6 → 3.1.7
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.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/test/unit/autorunner.rb +37 -36
- data/lib/test/unit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8c936b362c725433ebd125ef69157917ea0fda1
|
4
|
+
data.tar.gz: 025132e2049808eefb3ce43a81de19122fa7f93a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8344b2553f2e81b8c645f652be329e9f0ccf18b6d738d5407d378c86a670c1b22371ff32294bf1bcc4851dcb1c6e53668827cefe62d26319114b3b7df2da5631
|
7
|
+
data.tar.gz: 193991a49ed67e3b18605e23d0a051a51c6b2ed6604c5897cb37ac93c3396791543f272689e525a1e4cdf0b1c76fb553261cd6eee34b80fdb1bbbc894f8092db
|
data/doc/text/news.md
CHANGED
data/lib/test/unit/autorunner.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require "English"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require "test/unit/color-scheme"
|
4
|
+
require "test/unit/priority"
|
5
|
+
require "test/unit/attribute-matcher"
|
6
|
+
require "test/unit/testcase"
|
7
|
+
require "optparse"
|
7
8
|
|
8
9
|
module Test
|
9
10
|
module Unit
|
@@ -80,14 +81,14 @@ module Test
|
|
80
81
|
end
|
81
82
|
|
82
83
|
register_collector(:descendant) do |auto_runner|
|
83
|
-
require
|
84
|
+
require "test/unit/collector/descendant"
|
84
85
|
collector = Collector::Descendant.new
|
85
86
|
collector.filter = auto_runner.filters
|
86
|
-
collector.collect($0.sub(/\.rb\Z/,
|
87
|
+
collector.collect($0.sub(/\.rb\Z/, ""))
|
87
88
|
end
|
88
89
|
|
89
90
|
register_collector(:load) do |auto_runner|
|
90
|
-
require
|
91
|
+
require "test/unit/collector/load"
|
91
92
|
collector = Collector::Load.new
|
92
93
|
unless auto_runner.pattern.empty?
|
93
94
|
collector.patterns.replace(auto_runner.pattern)
|
@@ -103,7 +104,7 @@ module Test
|
|
103
104
|
|
104
105
|
# JUST TEST!
|
105
106
|
# register_collector(:xml) do |auto_runner|
|
106
|
-
# require
|
107
|
+
# require "test/unit/collector/xml"
|
107
108
|
# collector = Collector::XML.new
|
108
109
|
# collector.filter = auto_runner.filters
|
109
110
|
# collector.collect(auto_runner.to_run[0])
|
@@ -111,15 +112,15 @@ module Test
|
|
111
112
|
|
112
113
|
# deprecated
|
113
114
|
register_collector(:object_space) do |auto_runner|
|
114
|
-
require
|
115
|
+
require "test/unit/collector/objectspace"
|
115
116
|
c = Collector::ObjectSpace.new
|
116
117
|
c.filter = auto_runner.filters
|
117
|
-
c.collect($0.sub(/\.rb\Z/,
|
118
|
+
c.collect($0.sub(/\.rb\Z/, ""))
|
118
119
|
end
|
119
120
|
|
120
121
|
# deprecated
|
121
122
|
register_collector(:dir) do |auto_runner|
|
122
|
-
require
|
123
|
+
require "test/unit/collector/dir"
|
123
124
|
c = Collector::Dir.new
|
124
125
|
c.filter = auto_runner.filters
|
125
126
|
unless auto_runner.pattern.empty?
|
@@ -130,7 +131,7 @@ module Test
|
|
130
131
|
end
|
131
132
|
c.base = auto_runner.base
|
132
133
|
$:.push(auto_runner.base) if auto_runner.base
|
133
|
-
c.collect(*(auto_runner.to_run.empty? ? [
|
134
|
+
c.collect(*(auto_runner.to_run.empty? ? ["."] : auto_runner.to_run))
|
134
135
|
end
|
135
136
|
|
136
137
|
attr_reader :suite, :runner_options
|
@@ -184,35 +185,35 @@ module Test
|
|
184
185
|
o.banner = "Test::Unit automatic runner."
|
185
186
|
o.banner << "\nUsage: #{$0} [options] [-- untouched arguments]"
|
186
187
|
|
187
|
-
o.on(
|
188
|
+
o.on("-r", "--runner=RUNNER", RUNNERS,
|
188
189
|
"Use the given RUNNER.",
|
189
190
|
"(" + keyword_display(RUNNERS) + ")") do |r|
|
190
191
|
@runner = r
|
191
192
|
end
|
192
193
|
|
193
|
-
o.on(
|
194
|
+
o.on("--collector=COLLECTOR", COLLECTORS,
|
194
195
|
"Use the given COLLECTOR.",
|
195
196
|
"(" + keyword_display(COLLECTORS) + ")") do |collector|
|
196
197
|
@collector = collector
|
197
198
|
end
|
198
199
|
|
199
200
|
if (@standalone)
|
200
|
-
o.on(
|
201
|
+
o.on("-b", "--basedir=DIR", "Base directory of test suites.") do |b|
|
201
202
|
@base = b
|
202
203
|
end
|
203
204
|
|
204
|
-
o.on(
|
205
|
+
o.on("-w", "--workdir=DIR", "Working directory to run tests.") do |w|
|
205
206
|
@workdir = w
|
206
207
|
end
|
207
208
|
|
208
|
-
o.on(
|
209
|
+
o.on("--default-test-path=PATH",
|
209
210
|
"Add PATH to the default test paths.",
|
210
211
|
"The PATH is used when user doesn't specify any test path.",
|
211
212
|
"You can specify this option multiple times.") do |path|
|
212
213
|
@default_test_paths << path
|
213
214
|
end
|
214
215
|
|
215
|
-
o.on(
|
216
|
+
o.on("-a", "--add=TORUN", Array,
|
216
217
|
"Add TORUN to the list of things to run;",
|
217
218
|
"can be a file or a directory.") do |paths|
|
218
219
|
paths.each do |path|
|
@@ -221,19 +222,19 @@ module Test
|
|
221
222
|
end
|
222
223
|
|
223
224
|
@pattern = []
|
224
|
-
o.on(
|
225
|
+
o.on("-p", "--pattern=PATTERN", Regexp,
|
225
226
|
"Match files to collect against PATTERN.") do |e|
|
226
227
|
@pattern << e
|
227
228
|
end
|
228
229
|
|
229
230
|
@exclude = []
|
230
|
-
o.on(
|
231
|
+
o.on("-x", "--exclude=PATTERN", Regexp,
|
231
232
|
"Ignore files to collect against PATTERN.") do |e|
|
232
233
|
@exclude << e
|
233
234
|
end
|
234
235
|
end
|
235
236
|
|
236
|
-
o.on(
|
237
|
+
o.on("-n", "--name=NAME", String,
|
237
238
|
"Runs tests matching NAME.",
|
238
239
|
"Use '/PATTERN/' for NAME to use regular expression.") do |name|
|
239
240
|
name = (%r{\A/(.*)/\Z} =~ name ? Regexp.new($1) : name)
|
@@ -247,7 +248,7 @@ module Test
|
|
247
248
|
end
|
248
249
|
end
|
249
250
|
|
250
|
-
o.on(
|
251
|
+
o.on("--ignore-name=NAME", String,
|
251
252
|
"Ignores tests matching NAME.",
|
252
253
|
"Use '/PATTERN/' for NAME to use regular expression.") do |n|
|
253
254
|
n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
|
@@ -259,7 +260,7 @@ module Test
|
|
259
260
|
end
|
260
261
|
end
|
261
262
|
|
262
|
-
o.on(
|
263
|
+
o.on("-t", "--testcase=TESTCASE", String,
|
263
264
|
"Runs tests in TestCases matching TESTCASE.",
|
264
265
|
"Use '/PATTERN/' for TESTCASE to use regular expression.") do |n|
|
265
266
|
n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
|
@@ -268,7 +269,7 @@ module Test
|
|
268
269
|
end
|
269
270
|
end
|
270
271
|
|
271
|
-
o.on(
|
272
|
+
o.on("--ignore-testcase=TESTCASE", String,
|
272
273
|
"Ignores tests in TestCases matching TESTCASE.",
|
273
274
|
"Use '/PATTERN/' for TESTCASE to use regular expression.") do |n|
|
274
275
|
n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
|
@@ -277,7 +278,7 @@ module Test
|
|
277
278
|
end
|
278
279
|
end
|
279
280
|
|
280
|
-
o.on(
|
281
|
+
o.on("--location=LOCATION", String,
|
281
282
|
"Runs tests that defined in LOCATION.",
|
282
283
|
"LOCATION is one of PATH:LINE, PATH or LINE") do |location|
|
283
284
|
if /\A\d+\z/ =~ location
|
@@ -290,7 +291,7 @@ module Test
|
|
290
291
|
add_location_filter(path, line)
|
291
292
|
end
|
292
293
|
|
293
|
-
o.on(
|
294
|
+
o.on("--attribute=EXPRESSION", String,
|
294
295
|
"Runs tests that matches EXPRESSION.",
|
295
296
|
"EXPRESSION is evaluated as Ruby's expression.",
|
296
297
|
"Test attribute name can be used with no receiver in EXPRESSION.",
|
@@ -328,7 +329,7 @@ module Test
|
|
328
329
|
Priority.default = priority
|
329
330
|
end
|
330
331
|
|
331
|
-
o.on(
|
332
|
+
o.on("-I", "--load-path=DIR[#{File::PATH_SEPARATOR}DIR...]",
|
332
333
|
"Appends directory list to $LOAD_PATH.") do |dirs|
|
333
334
|
$LOAD_PATH.concat(dirs.split(File::PATH_SEPARATOR))
|
334
335
|
end
|
@@ -364,23 +365,23 @@ module Test
|
|
364
365
|
option_builder.call(self, o)
|
365
366
|
end
|
366
367
|
|
367
|
-
o.on(
|
368
|
+
o.on("--",
|
368
369
|
"Stop processing options so that the",
|
369
370
|
"remaining options will be passed to the",
|
370
371
|
"test."){o.terminate}
|
371
372
|
|
372
|
-
o.on(
|
373
|
+
o.on("-h", "--help", "Display this help."){puts o; exit}
|
373
374
|
|
374
375
|
o.on_tail
|
375
|
-
o.on_tail(
|
376
|
+
o.on_tail("Deprecated options:")
|
376
377
|
|
377
|
-
o.on_tail(
|
378
|
+
o.on_tail("--console", "Console runner (use --runner).") do
|
378
379
|
warn("Deprecated option (--console).")
|
379
380
|
@runner = self.class.runner(:console)
|
380
381
|
end
|
381
382
|
|
382
383
|
if RUNNERS[:fox]
|
383
|
-
o.on_tail(
|
384
|
+
o.on_tail("--fox", "Fox runner (use --runner).") do
|
384
385
|
warn("Deprecated option (--fox).")
|
385
386
|
@runner = self.class.runner(:fox)
|
386
387
|
end
|
@@ -424,7 +425,7 @@ module Test
|
|
424
425
|
end
|
425
426
|
|
426
427
|
def load_config(file)
|
427
|
-
require
|
428
|
+
require "yaml"
|
428
429
|
config = YAML.load(File.read(file))
|
429
430
|
runner_name = config["runner"]
|
430
431
|
@runner = self.class.runner(runner_name) || @runner
|
@@ -507,6 +508,6 @@ module Test
|
|
507
508
|
end
|
508
509
|
end
|
509
510
|
|
510
|
-
require
|
511
|
-
require
|
512
|
-
require
|
511
|
+
require "test/unit/runner/console"
|
512
|
+
require "test/unit/runner/emacs"
|
513
|
+
require "test/unit/runner/xml"
|
data/lib/test/unit/version.rb
CHANGED