2
require 'testunit_test_util'
4
class TestUnitPending < Test::Unit::TestCase
5
include TestUnitTestUtil
7
class TestCase < Test::Unit::TestCase
10
Test::Unit::TestSuite.new(name)
16
pend("2nd pend. Should not be reached here.")
17
assert(true, "Should not be reached here too.")
20
def test_pend_with_failure_in_block
21
pend("Wait a minute") do
22
raise "Not implemented yet"
24
assert(true, "Reached here.")
27
def test_pend_with_no_failure_in_block
28
pend("Wait a minute") do
31
assert(true, "Not reached here.")
37
result = _run_test("test_pend") {|t| test = t}
38
assert_equal("1 tests, 0 assertions, 0 failures, 0 errors, 1 pendings, " \
39
"0 omissions, 0 notifications",
41
assert_fault_messages(["1st pend"], result.pendings)
42
assert_true(test.interrupted?)
45
def test_pend_with_failure_in_block
47
result = _run_test("test_pend_with_failure_in_block") {|t| test = t}
48
assert_equal("1 tests, 1 assertions, 0 failures, 0 errors, 1 pendings, " \
49
"0 omissions, 0 notifications",
51
assert_fault_messages(["Wait a minute"], result.pendings)
52
assert_false(test.interrupted?)
55
def test_pend_with_no_failure_in_block
57
result = _run_test("test_pend_with_no_failure_in_block") {|t| test = t}
58
assert_equal("1 tests, 1 assertions, 1 failures, 0 errors, 0 pendings, " \
59
"0 omissions, 0 notifications",
61
assert_fault_messages(["Pending block should not be passed: Wait a minute."],
63
assert_true(test.interrupted?)
67
def _run_test(name, &block)
68
super(TestCase, name, &block)