| Class | Test::Unit::UI::TestRunnerMediator |
| In: |
test/unit/ui/testrunnermediator.rb
|
| Parent: | Object |
| RESET | = | name + "::RESET" |
| STARTED | = | name + "::STARTED" |
| FINISHED | = | name + "::FINISHED" |
Creates a new TestRunnerMediator initialized to run the passed suite.
# File test/unit/ui/testrunnermediator.rb, line 26 def initialize(suite) @suite = suite end
Runs the suite the TestRunnerMediator was created with.
# File test/unit/ui/testrunnermediator.rb, line 32 def run_suite Unit.run = true begin_time = Time.now notify_listeners(RESET, @suite.size) result = create_result notify_listeners(STARTED, result) result_listener = result.add_listener(TestResult::CHANGED) do |updated_result| notify_listeners(TestResult::CHANGED, updated_result) end fault_listener = result.add_listener(TestResult::FAULT) do |fault| notify_listeners(TestResult::FAULT, fault) end @suite.run(result) do |channel, value| notify_listeners(channel, value) end result.remove_listener(TestResult::FAULT, fault_listener) result.remove_listener(TestResult::CHANGED, result_listener) end_time = Time.now elapsed_time = end_time - begin_time notify_listeners(FINISHED, elapsed_time) #"Finished in #{elapsed_time} seconds.") return result end
ruby-doc.org is hosted and run by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. Ruby-doc.org was created in 2002 to promote the Ruby language and to help other Ruby hackers.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.