Class: Nitrous::TestResult
- Inherits:
-
Object
- Object
- Nitrous::TestResult
- Defined in:
- lib/nitrous/test_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(test) ⇒ TestResult
constructor
A new instance of TestResult.
- #pass_fail_skip ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(test) ⇒ TestResult
Returns a new instance of TestResult.
4 5 6 |
# File 'lib/nitrous/test_result.rb', line 4 def initialize(test) @test, @errors = test, [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/nitrous/test_result.rb', line 3 def errors @errors end |
Instance Method Details
#pass_fail_skip ⇒ Object
12 13 14 15 |
# File 'lib/nitrous/test_result.rb', line 12 def pass_fail_skip return "Skipped" if @test.skip? @errors.empty? ? "Passed" : "Failed" end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/nitrous/test_result.rb', line 8 def to_s %{ #{@test}: #{pass_fail_skip}} end |