Module: Test::Unit::TestResultFailureSupport

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#failuresObject (readonly)

Returns the value of attribute failures



131
132
133
# File 'lib/test/unit/failure.rb', line 131

def failures
  @failures
end

Instance Method Details

#add_failure(failure) ⇒ Object

Records a Test::Unit::Failure.



134
135
136
137
138
# File 'lib/test/unit/failure.rb', line 134

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

#failure_countObject

Returns the number of failures this TestResult has recorded.



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

def failure_count
  @failures.size
end

#failure_occurred?Boolean

Returns:

  • (Boolean)


146
147
148
# File 'lib/test/unit/failure.rb', line 146

def failure_occurred?
  not @failures.empty?
end