Class: Test::Unit::Omission
- Inherits:
-
Object
- Object
- Test::Unit::Omission
- Includes:
- Util::BacktraceFilter
- Defined in:
- lib/test/unit/omission.rb
Constant Summary
- SINGLE_CHARACTER =
'O'- LABEL =
"Omission"
Constants included from Util::BacktraceFilter
Util::BacktraceFilter::TESTUNIT_FILE_SEPARATORS, Util::BacktraceFilter::TESTUNIT_PREFIX, Util::BacktraceFilter::TESTUNIT_RB_FILE
Instance Attribute Summary (collapse)
-
- (Object) location
readonly
Returns the value of attribute location.
-
- (Object) message
readonly
Returns the value of attribute message.
-
- (Object) method_name
readonly
Returns the value of attribute method_name.
-
- (Object) test_name
readonly
Returns the value of attribute test_name.
Instance Method Summary (collapse)
- - (Boolean) critical?
-
- (Omission) initialize(test_name, location, message, options = {})
constructor
Creates a new Omission with the given location and message.
- - (Object) label
-
- (Object) long_display
Returns a verbose version of the error description.
-
- (Object) short_display
Returns a brief version of the error description.
-
- (Object) single_character_display
Returns a single character representation of a omission.
-
- (Object) to_s
Overridden to return long_display.
Methods included from Util::BacktraceFilter
Constructor Details
- (Omission) initialize(test_name, location, message, options = {})
Creates a new Omission with the given location and message.
15 16 17 18 19 20 |
# File 'lib/test/unit/omission.rb', line 15 def initialize(test_name, location, , ={}) @test_name = test_name @location = location @message = @method_name = [:method_name] end |
Instance Attribute Details
- (Object) location (readonly)
Returns the value of attribute location
7 8 9 |
# File 'lib/test/unit/omission.rb', line 7 def location @location end |
- (Object) message (readonly)
Returns the value of attribute message
7 8 9 |
# File 'lib/test/unit/omission.rb', line 7 def @message end |
- (Object) method_name (readonly)
Returns the value of attribute method_name
8 9 10 |
# File 'lib/test/unit/omission.rb', line 8 def method_name @method_name end |
- (Object) test_name (readonly)
Returns the value of attribute test_name
7 8 9 |
# File 'lib/test/unit/omission.rb', line 7 def test_name @test_name end |
Instance Method Details
- (Boolean) critical?
47 48 49 |
# File 'lib/test/unit/omission.rb', line 47 def critical? true end |
- (Object) label
27 28 29 |
# File 'lib/test/unit/omission.rb', line 27 def label LABEL end |
- (Object) long_display
Returns a verbose version of the error description.
37 38 39 40 |
# File 'lib/test/unit/omission.rb', line 37 def long_display backtrace = filter_backtrace(location).join("\n") "#{label}: #{@message}\n#{@test_name}\n#{backtrace}" end |
- (Object) short_display
Returns a brief version of the error description.
32 33 34 |
# File 'lib/test/unit/omission.rb', line 32 def short_display "#{@test_name}: #{@message.split("\n")[0]}" end |
- (Object) single_character_display
Returns a single character representation of a omission.
23 24 25 |
# File 'lib/test/unit/omission.rb', line 23 def single_character_display SINGLE_CHARACTER end |
- (Object) to_s
Overridden to return long_display.
43 44 45 |
# File 'lib/test/unit/omission.rb', line 43 def to_s long_display end |