test-unit 2.4.1 → 2.4.2

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/TODO CHANGED
@@ -1,5 +1 @@
1
- * mock.
2
- * data-driven test.
3
- * port ruby trunk's assert_equal's intelligent inspection
4
- when inspected expected and actual are same content
5
- string.
1
+ Do you have it?
@@ -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 |n|
206
- n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
207
- case n
208
- when Regexp
209
- @filters << proc{|t| n =~ t.method_name ? true : false}
210
- else
211
- @filters << proc{|t| n == t.method_name}
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
 
@@ -489,6 +489,7 @@ module Test
489
489
  def ==(other)
490
490
  return false unless other.kind_of?(self.class)
491
491
  return false unless @method_name == other.method_name
492
+ return false unless data_label == other.data_label
492
493
  self.class == other.class
493
494
  end
494
495
 
@@ -1,5 +1,5 @@
1
1
  module Test
2
2
  module Unit
3
- VERSION = '2.4.1'
3
+ VERSION = '2.4.2'
4
4
  end
5
5
  end
@@ -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: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 4
9
- - 1
10
- version: 2.4.1
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-09 00:00:00 Z
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