Class: Drntest::TestRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/drntest/test-runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, target) ⇒ TestRunner

Returns a new instance of TestRunner.



33
34
35
36
37
# File 'lib/drntest/test-runner.rb', line 33

def initialize(config, target)
  @config = config
  @target_path = Pathname(target).expand_path
  @engine = Engine.new(@config)
end

Instance Method Details

#runObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/drntest/test-runner.rb', line 39

def run
  relative_target_path = @target_path.relative_path_from(@config.suite_path)
  print "#{relative_target_path}: "
  @engine.start(@target_path)
  begin
    results = process_requests
    raise EngineStalled.new if results.status == :no_response
  ensure
    @engine.stop
  end
  results
end