Class: TestUnitRunner

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

Class Method Summary collapse

Class Method Details

.run_file(filename) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/gorgon/test_unit_runner.rb', line 32

def self.run_file(filename)
  GorgonTestCases.clear_cases!
  load filename

  result = Test::Unit::TestResult.new
  output = []
  result.add_listener(Test::Unit::TestResult::FAULT) do |value|
    output << value
  end

  GorgonTestCases.cases.each do |klass|
    # Not all descendants of TestCase are actually runnable, but they do all implement #suite
    # Calling suite.run will give us only runnable tests
    klass.suite.run(result) {|s,n|;}
  end

  output
end

.runnerObject



51
52
53
# File 'lib/gorgon/test_unit_runner.rb', line 51

def self.runner
  :test_unit
end