Class: Test::Unit::UI::TestRunnerMediator

Inherits:
Object
  • Object
show all
Defined in:
lib/test-unit-ext/always-show-result.rb

Instance Method Summary collapse

Instance Method Details

#notify_listeners(channel_name, *arguments) ⇒ Object



21
22
23
24
# File 'lib/test-unit-ext/always-show-result.rb', line 21

def notify_listeners(channel_name, *arguments)
  @notified_finished = true if channel_name == FINISHED
  super
end

#original_run_suiteObject



7
# File 'lib/test-unit-ext/always-show-result.rb', line 7

alias_method :original_run_suite, :run_suite

#run_suiteObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/test-unit-ext/always-show-result.rb', line 8

def run_suite
  @notified_finished = false
  begin_time = Time.now
  original_run_suite
rescue Interrupt
  unless @notified_finished
    end_time = Time.now
    elapsed_time = end_time - begin_time
    notify_listeners(FINISHED, elapsed_time)
  end
  raise
end