Class: Test::Unit::UI::Monkey::TestRunner

Inherits:
Object
  • Object
show all
Extended by:
TestRunnerUtilities
Defined in:
lib/monkeytest/ui.rb,
lib/monkeytest/ui/console.rb

Overview

Runs a Test::Unit::TestSuite on the console.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(suite, outputLevel = :normal, io = nil) ⇒ TestRunner

Creates a new TestRunner for running the passed suite. If quiet_mode is true, the output while running is limited to progress dots, errors and failures, and the final result. io specifies where runner output should go to; defaults to STDOUT.



27
28
29
30
31
32
33
34
35
# File 'lib/monkeytest/ui.rb', line 27

def initialize(suite, outputLevel=:normal, io=nil)
  @suite = suite
  @suite = suite.suite if suite.respond_to?(:suite)
  @outputLevel = :normal
  @faults = Array.new
  @results = MonkeyTest::TestSuite.new
  @failed = false
  @lastAssertionTotal = 0
end

Instance Attribute Details

#noColorObject

Returns the value of attribute noColor.



19
20
21
# File 'lib/monkeytest/ui.rb', line 19

def noColor
  @noColor
end

Instance Method Details

#startObject

Begins the test run.



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/monkeytest/ui.rb', line 38

def start
  setup_mediator
  attach_to_mediator
  case OUTPUT_FORMAT
    when :console
      require 'monkeytest/ui/console'
    when :html
      require 'monkeytest/ui/html'
  end
  return start_mediator
end