Class: Test::Unit::UI::Console::TestRunner

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

Instance Method Summary collapse

Instance Method Details

#add_fault(fault) ⇒ Object



55
56
57
58
# File 'lib/monkeyspecdoc.rb', line 55

def add_fault(fault)
  @faults << fault
  @already_outputted = true
end

#test_finished(name) ⇒ Object



60
61
62
63
64
65
66
67
68
# File 'lib/monkeyspecdoc.rb', line 60

def test_finished(name)
  if fault = @faults.find {|f| f.test_name == name}
    fault_type = fault.is_a?(Test::Unit::Failure) ? "FAILED" : "ERROR"
    output("\e[0;31m#{fault_type}\e[0m (#{@faults.length})")
  else
    output("\e[0;32mOK\e[0m")
  end
  @already_outputted = false
end

#test_started(name) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/monkeyspecdoc.rb', line 41

def test_started(name)
  ctx, should = split_shoulda_names(name)
  unless ctx.nil? or should.nil?
    if ctx != @ctx
      nl
      output("#{ctx}:")
    end
    @ctx = ctx
    output_single("- #{should}: ")
  else
    test_started_old(name)
  end
end

#test_started_oldObject



39
# File 'lib/monkeyspecdoc.rb', line 39

alias_method :test_started_old, :test_started