Class: Test::Unit::TestCase
- Extended by:
- Tap::Test::Extensions
- Defined in:
- lib/tap/test.rb,
lib/tap/test.rb
Overview
:stopdoc:
Class Attribute Summary collapse
-
.run_test_suite ⇒ Object
Returns the value of attribute run_test_suite.
-
.skip_messages ⇒ Object
readonly
Returns the value of attribute skip_messages.
Class Method Summary collapse
- .inherited(child) ⇒ Object
- .original_suite ⇒ Object
-
.skip_test(msg = nil) ⇒ Object
Causes a test suite to be skipped.
- .suite ⇒ Object
- .tap_original_test_case_inherited ⇒ Object
Methods included from Tap::Test::Extensions
acts_as_file_test, acts_as_script_test, acts_as_subset_test, acts_as_tap_test
Class Attribute Details
.run_test_suite ⇒ Object
Returns the value of attribute run_test_suite.
38 39 40 |
# File 'lib/tap/test.rb', line 38 def run_test_suite @run_test_suite end |
.skip_messages ⇒ Object (readonly)
Returns the value of attribute skip_messages.
42 43 44 |
# File 'lib/tap/test.rb', line 42 def @skip_messages end |
Class Method Details
.inherited(child) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/tap/test.rb', line 30 def inherited(child) super tap_original_test_case_inherited(child) child.instance_variable_set(:@skip_messages, []) child.instance_variable_set(:@run_test_suite, true) end |
.original_suite ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/tap/test.rb', line 51 def suite # :nodoc: if run_test_suite original_suite else = .compact.join(', ') puts "Skipping #{name}#{.empty? ? '' : ': ' + }" # return an empty test suite of the appropriate name Test::Unit::TestSuite.new(name) end end |
.skip_test(msg = nil) ⇒ Object
Causes a test suite to be skipped. If a message is given, it will print and notify the user the test suite has been skipped.
18 19 20 21 |
# File 'lib/tap/test.rb', line 18 def skip_test(msg=nil) @@test_suites.delete(self) puts "Skipping #{self}#{msg.empty? ? '' : ': ' + msg}" end |
.suite ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/tap/test.rb', line 56 def suite # :nodoc: if run_test_suite original_suite else = .compact.join(', ') puts "Skipping #{name}#{.empty? ? '' : ': ' + }" # return an empty test suite of the appropriate name Test::Unit::TestSuite.new(name) end end |
.tap_original_test_case_inherited ⇒ Object
28 29 30 31 32 33 |
# File 'lib/tap/test.rb', line 28 def inherited(child) super tap_original_test_case_inherited(child) child.instance_variable_set(:@skip_messages, []) child.instance_variable_set(:@run_test_suite, true) end |