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

Inherits:
Object
  • Object
show all
Defined in:
lib/devcreek_testrunnermediator.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ TestRunnerMediator

Returns a new instance of TestRunnerMediator.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/devcreek_testrunnermediator.rb', line 13

def initialize(*args)
  result = old_initialize(*args)
  
  add_listener(Test::Unit::UI::TestRunnerMediator::STARTED) do |test_result| 
    DevCreek::TestUnitAdapter.instance().start
  end
  
  add_listener(Test::Unit::TestCase::STARTED) do |name| 
    DevCreek::TestUnitAdapter.instance().test_started(name)
  end
  
  add_listener(Test::Unit::TestResult::FAULT) do |fault| 
    DevCreek::TestUnitAdapter.instance().test_failed(fault.test_name, (fault.instance_of? Test::Unit::Failure))
  end
  
  add_listener(Test::Unit::TestCase::FINISHED) do |name|
    DevCreek::TestUnitAdapter.instance().test_finished(name)
  end
  
  add_listener(Test::Unit::UI::TestRunnerMediator::FINISHED) do |elapsed_time| 
    DevCreek::TestUnitAdapter.instance().end
  end
  
  return result
end

Instance Method Details

#old_initializeObject



11
# File 'lib/devcreek_testrunnermediator.rb', line 11

alias_method :old_initialize,  :initialize