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 CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.6.1 / 2010-0-07
2
+
3
+ * updated Test::Unit shim to be a little more robust
4
+
1
5
  == 0.6.0 / 2010-05-02
2
6
 
3
7
  This release removes crufty methods that are rarely used and
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
- @run_test_suite = false
57
- @skip_messages << msg
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 @run_test_suite
67
- original_suite
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
 
@@ -2,7 +2,7 @@ module Tap
2
2
  module Test
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  VERSION="#{MAJOR}.#{MINOR}.#{TINY}"
8
8
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 0
9
- version: 0.6.0
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-02 00:00:00 -06:00
17
+ date: 2010-05-07 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency