Class: Nitrous::TestResult

Inherits:
Object
  • Object
show all
Defined in:
lib/nitrous/test_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorsObject (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_skipObject



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_sObject



8
9
10
# File 'lib/nitrous/test_result.rb', line 8

def to_s
  %{  #{@test}: #{pass_fail_skip}}
end