tap-test 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History +4 -0
- data/lib/tap/test/unit.rb +13 -16
- data/lib/tap/test/version.rb +1 -1
- metadata +3 -3
data/History
CHANGED
data/lib/tap/test/unit.rb
CHANGED
@@ -41,38 +41,35 @@ else
|
|
41
41
|
# tricky than in the Mini::Test Test::Unit.
|
42
42
|
class Test::Unit::TestCase
|
43
43
|
class << self
|
44
|
-
alias tap_original_test_case_inherited inherited
|
45
|
-
|
46
|
-
def inherited(child)
|
47
|
-
super
|
48
|
-
tap_original_test_case_inherited(child)
|
49
|
-
child.instance_variable_set(:@skip_messages, [])
|
50
|
-
child.instance_variable_set(:@run_test_suite, true)
|
51
|
-
end
|
52
|
-
|
53
44
|
# Causes a test suite to be skipped. If a message is given, it will
|
54
45
|
# print and notify the user the test suite has been skipped.
|
55
46
|
def skip_test(msg=nil)
|
56
|
-
@
|
57
|
-
|
47
|
+
@skip_test_suite = true
|
48
|
+
skip_messages << msg
|
58
49
|
end
|
59
|
-
|
50
|
+
|
60
51
|
alias :original_suite :suite
|
61
52
|
|
62
53
|
# Modifies the default suite method to skip the suit unless
|
63
54
|
# run_test_suite is true. If the test is skipped, the skip_messages
|
64
55
|
# will be printed along with the default 'Skipping <Test>' message.
|
65
56
|
def suite # :nodoc:
|
66
|
-
if @
|
67
|
-
|
68
|
-
else
|
69
|
-
skip_message = @skip_messages.compact.join(', ')
|
57
|
+
if (@skip_test_suite ||= false)
|
58
|
+
skip_message = skip_messages.compact.join(', ')
|
70
59
|
puts "Skipping #{name}#{skip_message.empty? ? '' : ': ' + skip_message}"
|
71
60
|
|
72
61
|
# return an empty test suite of the appropriate name
|
73
62
|
Test::Unit::TestSuite.new(name)
|
63
|
+
else
|
64
|
+
original_suite
|
74
65
|
end
|
75
66
|
end
|
67
|
+
|
68
|
+
protected
|
69
|
+
|
70
|
+
def skip_messages # :nodoc:
|
71
|
+
@skip_messages ||= []
|
72
|
+
end
|
76
73
|
end
|
77
74
|
end
|
78
75
|
|
data/lib/tap/test/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
8
|
+
- 1
|
9
|
+
version: 0.6.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Simon Chiang
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-07 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|