123456789_123456789_123456789_123456789_123456789_

Module: Test::Unit::TestResultFailureSupport

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/test/unit/failure.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#failure_occurred?Boolean (readonly)

[ GitHub ]

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

def failure_occurred?
  not @failures.empty?
end

#failures (readonly)

[ GitHub ]

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

attr_reader :failures

Instance Method Details

#add_failure(failure)

Records a Failure.

[ GitHub ]

  
# File 'lib/test/unit/failure.rb', line 140

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

#failure_count

Returns the number of failures this TestResult has recorded.

[ GitHub ]

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

def failure_count
  @failures.size
end

#failure_summary (private)

[ GitHub ]

  
# File 'lib/test/unit/failure.rb', line 164

def failure_summary
  "#{failure_count} failures"
end

#initialize_containers (private)

[ GitHub ]

  
# File 'lib/test/unit/failure.rb', line 157

def initialize_containers
  super
  @failures = []
  @summary_generators << :failure_summary
  @problem_checkers << :failure_occurred?
end