Class: Drntest::Tester

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTester

Returns a new instance of Tester.



36
37
38
39
40
# File 'lib/drntest/tester.rb', line 36

def initialize
  @config = Configuration.new
  @test_pattern = nil
  @suite_pattern = nil
end

Class Method Details

.run(argv = nil) ⇒ Object



28
29
30
31
32
33
# File 'lib/drntest/tester.rb', line 28

def run(argv=nil)
  argv ||= ARGV.dup
  tester = new
  *targets = tester.parse_command_line_options(argv)
  tester.run(*targets)
end

Instance Method Details

#parse_command_line_options(command_line_options) ⇒ Object



42
43
44
45
# File 'lib/drntest/tester.rb', line 42

def parse_command_line_options(command_line_options)
  option_parser = create_option_parser
  option_parser.parse!(command_line_options)
end

#run(*targets) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/drntest/tester.rb', line 47

def run(*targets)
  test_suites_result = TestSuitesResult.new
  tests = load_tests(*targets)
  tests.each do |test|
    test_runner = TestRunner.new(@config, test)
    test_suites_result.test_results << test_runner.run
  end

  puts
  puts "==== Summary ===="
  p test_suites_result.summary

  test_suites_result.success?
end