diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/test/testunit/test_testresult.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/test/testunit/test_testresult.rb')
-rw-r--r-- | trunk/test/testunit/test_testresult.rb | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/trunk/test/testunit/test_testresult.rb b/trunk/test/testunit/test_testresult.rb deleted file mode 100644 index 95d631a082..0000000000 --- a/trunk/test/testunit/test_testresult.rb +++ /dev/null @@ -1,104 +0,0 @@ -# Author:: Nathaniel Talbott. -# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. -# License:: Ruby license. - -require 'test/unit/testcase' -require 'test/unit/testresult' - -module Test - module Unit - class TC_TestResult < TestCase - def setup - @my_result = TestResult.new - @my_result.add_assertion() - @my_result.add_failure("") - @my_result.add_error("") - end - def test_result_changed_notification - called1 = false - @my_result.add_listener( TestResult::CHANGED) { - |result| - assert_block("The result should be correct") { result == @my_result } - called1 = true - } - @my_result.add_assertion - assert_block("Should have been notified when the assertion happened") { called1 } - - called1, called2 = false, false - @my_result.add_listener( TestResult::CHANGED) { - |result| - assert_block("The result should be correct") { result == @my_result } - called2 = true - } - @my_result.add_assertion - assert_block("Both listeners should have been notified for a success") { called1 && called2 } - - called1, called2 = false, false - @my_result.add_failure("") - assert_block("Both listeners should have been notified for a failure") { called1 && called2 } - - called1, called2 = false, false - @my_result.add_error("") - assert_block("Both listeners should have been notified for an error") { called1 && called2 } - - called1, called2 = false, false - @my_result.add_run - assert_block("Both listeners should have been notified for a run") { called1 && called2 } - end - def test_fault_notification - called1 = false - fault = "fault" - @my_result.add_listener(TestResult::FAULT) { - | passed_fault | - assert_block("The fault should be correct") { passed_fault == fault } - called1 = true - } - - @my_result.add_assertion - assert_block("Should not have been notified when the assertion happened") { !called1 } - - @my_result.add_failure(fault) - assert_block("Should have been notified when the failure happened") { called1 } - - called1, called2 = false, false - @my_result.add_listener(TestResult::FAULT) { - | passed_fault | - assert_block("The fault should be correct") { passed_fault == fault } - called2 = true - } - - @my_result.add_assertion - assert_block("Neither listener should have been notified for a success") { !(called1 || called2) } - - called1, called2 = false, false - @my_result.add_failure(fault) - assert_block("Both listeners should have been notified for a failure") { called1 && called2 } - - called1, called2 = false, false - @my_result.add_error(fault) - assert_block("Both listeners should have been notified for an error") { called1 && called2 } - - called1, called2 = false, false - @my_result.add_run - assert_block("Neither listener should have been notified for a run") { !(called1 || called2) } - end - def test_passed? - result = TestResult.new - assert(result.passed?, "An empty result should have passed") - - result.add_assertion - assert(result.passed?, "Adding an assertion should not cause the result to not pass") - - result.add_run - assert(result.passed?, "Adding a run should not cause the result to not pass") - - result.add_failure("") - assert(!result.passed?, "Adding a failed assertion should cause the result to not pass") - - result = TestResult.new - result.add_error("") - assert(!result.passed?, "Adding an error should cause the result to not pass") - end - end - end -end |