123456789_123456789_123456789_123456789_123456789_

Module: Test::Unit::TestResultErrorSupport

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

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#error_occurred?Boolean (readonly)

[ GitHub ]

  
# File 'lib/test/unit/error.rb', line 141

def error_occurred?
  not @errors.empty?
end

#errors (readonly)

[ GitHub ]

  
# File 'lib/test/unit/error.rb', line 126

attr_reader :errors

Instance Method Details

#add_error(error)

Records a Error.

[ GitHub ]

  
# File 'lib/test/unit/error.rb', line 129

def add_error(error)
  @errors << error
  notify_fault(error)
  notify_changed
end

#error_count

Returns the number of errors this TestResult has recorded.

[ GitHub ]

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

def error_count
  @errors.size
end

#error_summary (private)

[ GitHub ]

  
# File 'lib/test/unit/error.rb', line 153

def error_summary
  "#{error_count} errors"
end

#initialize_containers (private)

[ GitHub ]

  
# File 'lib/test/unit/error.rb', line 146

def initialize_containers
  super
  @errors = []
  @summary_generators << :error_summary
  @problem_checkers << :error_occurred?
end