test-unit 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO +1 -5
- data/lib/test/unit/autorunner.rb +9 -7
- data/lib/test/unit/testcase.rb +1 -0
- data/lib/test/unit/version.rb +1 -1
- data/test/test-data.rb +14 -0
- metadata +4 -4
data/TODO
CHANGED
data/lib/test/unit/autorunner.rb
CHANGED
@@ -202,13 +202,15 @@ module Test
|
|
202
202
|
|
203
203
|
o.on('-n', '--name=NAME', String,
|
204
204
|
"Runs tests matching NAME.",
|
205
|
-
"(patterns may be used).") do |
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
205
|
+
"(patterns may be used).") do |name|
|
206
|
+
name = (%r{\A/(.*)/\Z} =~ name ? Regexp.new($1) : name)
|
207
|
+
@filters << lambda do |test|
|
208
|
+
return true if name === test.method_name
|
209
|
+
test_name_without_class_name = test.name.gsub(/\(.+?\)\z/, "")
|
210
|
+
if test_name_without_class_name != test.method_name
|
211
|
+
return true if name === test_name_without_class_name
|
212
|
+
end
|
213
|
+
false
|
212
214
|
end
|
213
215
|
end
|
214
216
|
|
data/lib/test/unit/testcase.rb
CHANGED
data/lib/test/unit/version.rb
CHANGED
data/test/test-data.rb
CHANGED
@@ -167,6 +167,20 @@ class TestData < Test::Unit::TestCase
|
|
167
167
|
"0 omissions, 0 notifications", result.to_s)
|
168
168
|
end
|
169
169
|
|
170
|
+
data("data set" => TestCalc::TestDataSet,
|
171
|
+
"n-data" => TestCalc::TestNData,
|
172
|
+
"dynamic-data-set" => TestCalc::TestDynamicDataSet,
|
173
|
+
"load-data-set" => TestCalc::TestLoadDataSet)
|
174
|
+
def test_equal(test_case)
|
175
|
+
suite = test_case.suite
|
176
|
+
positive_positive_test = suite.tests.find do |test|
|
177
|
+
test.data_label == "positive positive"
|
178
|
+
end
|
179
|
+
suite.tests.delete(positive_positive_test)
|
180
|
+
assert_equal(["test_plus[positive negative](#{test_case.name})"],
|
181
|
+
suite.tests.collect {|test| test.name}.sort)
|
182
|
+
end
|
183
|
+
|
170
184
|
def _run_test(test_case)
|
171
185
|
result = Test::Unit::TestResult.new
|
172
186
|
test = test_case.suite
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 2.4.
|
9
|
+
- 2
|
10
|
+
version: 2.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kouhei Sutou
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-26 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|