Class: Test::Unit::Omission
- Inherits:
-
Object
- Object
- Test::Unit::Omission
- Includes:
- Util::BacktraceFilter
- Defined in:
- lib/test/unit/omission.rb
Constant Summary collapse
- SINGLE_CHARACTER =
'O'
- LABEL =
"Omission"
Constants included from Util::BacktraceFilter
Util::BacktraceFilter::POWERASSERT_PREFIX, Util::BacktraceFilter::TESTUNIT_FILE_SEPARATORS, Util::BacktraceFilter::TESTUNIT_PREFIX, Util::BacktraceFilter::TESTUNIT_RB_FILE
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#test_name ⇒ Object
readonly
Returns the value of attribute test_name.
Instance Method Summary collapse
- #critical? ⇒ Boolean
-
#initialize(test_name, location, message, options = {}) ⇒ Omission
constructor
Creates a new Omission with the given location and message.
- #label ⇒ Object
-
#long_display ⇒ Object
Returns a verbose version of the error description.
-
#short_display ⇒ Object
Returns a brief version of the error description.
-
#single_character_display ⇒ Object
Returns a single character representation of a omission.
-
#to_s ⇒ Object
Overridden to return long_display.
Methods included from Util::BacktraceFilter
Constructor Details
#initialize(test_name, location, message, options = {}) ⇒ Omission
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
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/test/unit/omission.rb', line 7 def location @location end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/test/unit/omission.rb', line 7 def @message end |
#method_name ⇒ Object (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 |
#test_name ⇒ Object (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
#critical? ⇒ Boolean
47 48 49 |
# File 'lib/test/unit/omission.rb', line 47 def critical? true end |
#label ⇒ Object
27 28 29 |
# File 'lib/test/unit/omission.rb', line 27 def label LABEL end |
#long_display ⇒ Object
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 |
#short_display ⇒ Object
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 |
#single_character_display ⇒ Object
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 |
#to_s ⇒ Object
Overridden to return long_display.
43 44 45 |
# File 'lib/test/unit/omission.rb', line 43 def to_s long_display end |