# File test/unit/ui/testrunnermediator.rb, line 40 def run_suite @@run = true begin_time = Time.now notify_listeners(RESET, @suite.size) notify_listeners(STATUS_CHANGED, Status.new(Status::STARTED_RUNNING, "Started")) result = create_result result_listener = result.add_listener(TestResult::CHANGED) { | updated_result | notify_listeners(RESULT_CHANGED, updated_result) } fault_listener = result.add_listener(TestResult::FAULT) { | fault | notify_listeners(FAULT_ADDED, fault) } @suite.run(result) { | progress | notify_listeners(STATUS_CHANGED, Status.new(Status::FINISHED_TEST, progress)) } if (result.run_count == 0) result.add_failure(Failure.new("run", "No tests were run.")) 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(STATUS_CHANGED, Status.new(Status::FINISHED_RUNNING, "Finished in #{elapsed_time} seconds.")) return result end