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

Inherits:
TestRunner
  • Object
show all
Includes:
OutputLevel
Defined in:
lib/test/unit/ui/console/testrunner.rb

Overview

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

Direct Known Subclasses

Emacs::TestRunner

Constant Summary collapse

COLOR_SCHEMES =
{
  :default => {
    "success" => Color.new("green", :bold => true),
    "failure" => Color.new("red", :bold => true),
    "pending" => Color.new("magenta", :bold => true),
    "omission" => Color.new("blue", :bold => true),
    "notification" => Color.new("cyan", :bold => true),
    "error" => Color.new("yellow", :bold => true),
  },
}

Constants included from OutputLevel

OutputLevel::NORMAL, OutputLevel::PROGRESS_ONLY, OutputLevel::SILENT, OutputLevel::VERBOSE

Instance Method Summary collapse

Methods included from TestRunnerUtilities

#run, #start_command_line_test

Constructor Details

#initialize(suite, options = {}) ⇒ 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.



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

def initialize(suite, options={})
  super
  @output_level = @options[:output_level] || NORMAL
  @output = @options[:output] || STDOUT
  @use_color = @options[:use_color]
  @use_color = guess_color_availability if @use_color.nil?
  @color_scheme = COLOR_SCHEMES[:default]
  @reset_color = Color.new("reset")
  @already_outputted = false
  @faults = []
end

Instance Method Details

#startObject

Begins the test run.



51
52
53
54
55
# File 'lib/test/unit/ui/console/testrunner.rb', line 51

def start
  setup_mediator
  attach_to_mediator
  return start_mediator
end