Class: Rootage::ScenarioResult

Inherits:
StructX
  • Object
show all
Defined in:
lib/rootage/test-helper.rb

Overview

ScenarioResult is a result of scenario execution. This has result status, stdout, stdin, and etc, so you can analyze and check it.

Instance Method Summary collapse

Instance Method Details

#reportObject

Print the scenario result report.



37
38
39
40
41
42
# File 'lib/rootage/test-helper.rb', line 37

def report
  template = File.read(File.join(File.dirname(__FILE__), "scenario-test-result.erb"))
  File.open("scenario-test-result.txt", "a") do |file|
    file.write(ERB.new(template, nil, "<>").result(binding))
  end
end

#success?Boolean

Return true if the scenario succeeded.

Returns:

  • (Boolean)


32
33
34
# File 'lib/rootage/test-helper.rb', line 32

def success?
  exception.nil? or (exception.kind_of?(SystemExit) and exception.success?)
end