Module: Test::Unit::TestResultFailureSupport

Included in:
TestResult
Defined in:
lib/test/unit/failure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#failuresObject (readonly)

Returns the value of attribute failures.



137
138
139
# File 'lib/test/unit/failure.rb', line 137

def failures
  @failures
end

Instance Method Details

#add_failure(failure) ⇒ Object

Records a Test::Unit::Failure.



140
141
142
143
144
# File 'lib/test/unit/failure.rb', line 140

def add_failure(failure)
  @failures << failure
  notify_fault(failure)
  notify_changed
end

#failure_countObject

Returns the number of failures this TestResult has recorded.



148
149
150
# File 'lib/test/unit/failure.rb', line 148

def failure_count
  @failures.size
end

#failure_occurred?Boolean

Returns:

  • (Boolean)


152
153
154
# File 'lib/test/unit/failure.rb', line 152

def failure_occurred?
  not @failures.empty?
end