Module: Test::Unit::TestResultErrorSupport
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/test/unit/error.rb |
Instance Attribute Summary
- #error_occurred? ⇒ Boolean readonly
- #errors readonly
Instance Method Summary
-
#add_error(error)
Records a Error.
-
#error_count
Returns the number of errors this TestResult has recorded.
- #error_summary private
- #initialize_containers private
Instance Attribute Details
#error_occurred? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/test/unit/error.rb', line 137
def error_occurred? not @errors.empty? end
#errors (readonly)
[ GitHub ]# File 'lib/test/unit/error.rb', line 122
attr_reader :errors
Instance Method Details
#add_error(error)
Records a Error.
# File 'lib/test/unit/error.rb', line 125
def add_error(error) @errors << error notify_fault(error) notify_changed end
#error_count
Returns the number of errors this TestResult has recorded.
# File 'lib/test/unit/error.rb', line 133
def error_count @errors.size end
#error_summary (private)
[ GitHub ]# File 'lib/test/unit/error.rb', line 149
def error_summary "#{error_count} errors" end
#initialize_containers (private)
[ GitHub ]# File 'lib/test/unit/error.rb', line 142
def initialize_containers super @errors = [] @summary_generators << :error_summary @problem_checkers << :error_occurred? end