test-unit 3.2.2 → 3.2.3
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 +12 -1
- data/lib/test/unit/testcase.rb +5 -1
- data/lib/test/unit/version.rb +1 -1
- data/test/collector/test-descendant.rb +4 -0
- data/test/collector/test_dir.rb +5 -4
- data/test/collector/test_objectspace.rb +7 -5
- data/test/test-test-case.rb +4 -3
- data/test/test-test-suite.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc00d33f461d81ecfb9fd2ea0d0968bdf7ed3395
|
4
|
+
data.tar.gz: 169383ca5327b810e2613ac08b6a89c6cf77f309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4eab8012105cdfe92ea93cda5666b490e4a84d27af3c454726cd9b59769d9cc9c70329f945e02a951bc5c65d5de125ee77e2d1c3559bb4949f80a8b440476ca
|
7
|
+
data.tar.gz: 26c82141efe00a0992c704102a84a6564085fcfa91217e409c42d5ae672d3637c657aa6a65422cad15acd061b3c6709fb019ad6669413af9189ae473f31cd775
|
data/doc/text/news.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
-
## 3.2.3 - 2016-11-
|
3
|
+
## 3.2.3 - 2016-11-25 {#version-3-2-3}
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
|
7
|
+
* Fixed a bug that `--order` isn't applied.
|
8
|
+
[GitHub#129][Reported by Vít Ondruch]
|
9
|
+
|
10
|
+
### Thanks
|
11
|
+
|
12
|
+
* Vít Ondruch
|
13
|
+
|
14
|
+
## 3.2.2 - 2016-11-02 {#version-3-2-2}
|
4
15
|
|
5
16
|
### Improvements
|
6
17
|
|
data/lib/test/unit/testcase.rb
CHANGED
@@ -230,7 +230,11 @@ module Test
|
|
230
230
|
# Returns the current test order. This returns
|
231
231
|
# +:alphabetic+ by default.
|
232
232
|
def test_order
|
233
|
-
|
233
|
+
ancestors.each do |ancestor|
|
234
|
+
order = @@test_orders[ancestor]
|
235
|
+
return order if order
|
236
|
+
end
|
237
|
+
AVAILABLE_ORDERS.first
|
234
238
|
end
|
235
239
|
|
236
240
|
# Sets the current test order.
|
data/lib/test/unit/version.rb
CHANGED
@@ -31,6 +31,8 @@ class TestUnitCollectorDescendant < Test::Unit::TestCase
|
|
31
31
|
super
|
32
32
|
|
33
33
|
@test_case1 = Class.new(Test::Unit::TestCase) do
|
34
|
+
self.test_order = :alphabetic
|
35
|
+
|
34
36
|
def self.name
|
35
37
|
"test-case1"
|
36
38
|
end
|
@@ -43,6 +45,8 @@ class TestUnitCollectorDescendant < Test::Unit::TestCase
|
|
43
45
|
end
|
44
46
|
|
45
47
|
@test_case2 = Class.new(Test::Unit::TestCase) do
|
48
|
+
self.test_order = :alphabetic
|
49
|
+
|
46
50
|
def self.name
|
47
51
|
"test-case2"
|
48
52
|
end
|
data/test/collector/test_dir.rb
CHANGED
@@ -15,7 +15,7 @@ module Test
|
|
15
15
|
@contents = {'.' => self, '..' => parent}
|
16
16
|
instance_eval(&block) if(block)
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def file(name, contents)
|
20
20
|
@contents[name] = contents
|
21
21
|
end
|
@@ -74,7 +74,7 @@ module Test
|
|
74
74
|
end
|
75
75
|
|
76
76
|
attr_reader :object_space
|
77
|
-
|
77
|
+
|
78
78
|
def initialize(&block)
|
79
79
|
@root = Directory.new('/', self, &block)
|
80
80
|
@pwd = @root
|
@@ -295,7 +295,7 @@ module Test
|
|
295
295
|
assert_raises(LoadError) do
|
296
296
|
fs.require('bogus')
|
297
297
|
end
|
298
|
-
|
298
|
+
|
299
299
|
assert(fs.require('test_class1.rb'))
|
300
300
|
assert(!fs.require('test_class1.rb'))
|
301
301
|
c = []
|
@@ -345,6 +345,7 @@ module Test
|
|
345
345
|
def create_test(name)
|
346
346
|
t = Class.new(TestCase)
|
347
347
|
t.class_eval <<-EOC
|
348
|
+
self.test_order = :alphabetic
|
348
349
|
def self.name
|
349
350
|
"T\#{#{name}}"
|
350
351
|
end
|
@@ -373,7 +374,7 @@ module Test
|
|
373
374
|
expected = TestSuite.new('test_1.rb')
|
374
375
|
expected << @t1.suite
|
375
376
|
assert_equal(expected, @c.collect('test_1.rb'))
|
376
|
-
|
377
|
+
|
377
378
|
expected = TestSuite.new('t4.rb')
|
378
379
|
expected << @t4.suite
|
379
380
|
assert_equal(expected, @c.collect('t4.rb'))
|
@@ -11,6 +11,7 @@ module Test
|
|
11
11
|
class TC_ObjectSpace < TestCase
|
12
12
|
def setup
|
13
13
|
@tc1 = Class.new(TestCase) do
|
14
|
+
self.test_order = :alphabetic
|
14
15
|
def self.name
|
15
16
|
"tc_1"
|
16
17
|
end
|
@@ -21,6 +22,7 @@ module Test
|
|
21
22
|
end
|
22
23
|
|
23
24
|
@tc2 = Class.new(TestCase) do
|
25
|
+
self.test_order = :alphabetic
|
24
26
|
def self.name
|
25
27
|
"tc_2"
|
26
28
|
end
|
@@ -32,7 +34,7 @@ module Test
|
|
32
34
|
def test_4
|
33
35
|
end
|
34
36
|
end
|
35
|
-
|
37
|
+
|
36
38
|
@object_space = {Class => [@tc1, @tc2, @no_tc], String => ['']}
|
37
39
|
def @object_space.each_object(type)
|
38
40
|
self[type].each{|item| yield(item) }
|
@@ -50,14 +52,14 @@ module Test
|
|
50
52
|
def empty_suite
|
51
53
|
TestSuite.new(ObjectSpace::NAME)
|
52
54
|
end
|
53
|
-
|
55
|
+
|
54
56
|
def test_basic_collection
|
55
57
|
assert_equal(full_suite("name"), @c.collect("name"))
|
56
58
|
|
57
59
|
@c.filter = []
|
58
60
|
assert_equal(full_suite("name"), @c.collect("name"))
|
59
61
|
end
|
60
|
-
|
62
|
+
|
61
63
|
def test_filtered_collection
|
62
64
|
@c.filter = proc{false}
|
63
65
|
assert_equal(empty_suite, @c.collect)
|
@@ -76,10 +78,10 @@ module Test
|
|
76
78
|
|
77
79
|
@c.filter = [proc{nil}, proc{false}]
|
78
80
|
assert_equal(empty_suite, @c.collect)
|
79
|
-
|
81
|
+
|
80
82
|
@c.filter = [proc{nil}, proc{true}]
|
81
83
|
assert_equal(full_suite, @c.collect)
|
82
|
-
|
84
|
+
|
83
85
|
expected = TestSuite.new(ObjectSpace::NAME)
|
84
86
|
expected << (TestSuite.new(@tc1.name) << @tc1.new('test_1'))
|
85
87
|
expected << (TestSuite.new(@tc2.name) << @tc2.new('test_0'))
|
data/test/test-test-case.rb
CHANGED
@@ -465,9 +465,6 @@ module Test
|
|
465
465
|
end
|
466
466
|
end
|
467
467
|
|
468
|
-
assert_equal(["test_1", "test_a", "test_z"],
|
469
|
-
test_case.suite.tests.collect {|test| test.method_name})
|
470
|
-
|
471
468
|
test_case.test_order = :defined
|
472
469
|
assert_equal(["test_z", "test_1", "test_a"],
|
473
470
|
test_case.suite.tests.collect {|test| test.method_name})
|
@@ -513,6 +510,8 @@ module Test
|
|
513
510
|
|
514
511
|
def test_redefine_method
|
515
512
|
test_case = Class.new(Test::Unit::TestCase) do
|
513
|
+
self.test_order = :alphabetic
|
514
|
+
|
516
515
|
def test_name
|
517
516
|
end
|
518
517
|
alias_method :test_name2, :test_name
|
@@ -1012,6 +1011,8 @@ module Test
|
|
1012
1011
|
@parent_test_case = Class.new(TestCase) do
|
1013
1012
|
extend CallLogger
|
1014
1013
|
|
1014
|
+
self.test_order = :alphabetic
|
1015
|
+
|
1015
1016
|
class << self
|
1016
1017
|
def startup
|
1017
1018
|
called << :startup_parent
|
data/test/test-test-suite.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-11-
|
12
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: power_assert
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
version: '0'
|
230
230
|
requirements: []
|
231
231
|
rubyforge_project:
|
232
|
-
rubygems_version: 2.5.
|
232
|
+
rubygems_version: 2.5.2
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: An xUnit family unit testing framework for Ruby.
|