Class: Test::Unit::Notification
- Inherits:
-
Object
- Object
- Test::Unit::Notification
- Includes:
- Util::BacktraceFilter
- Defined in:
- lib/test/unit/notification.rb
Constant Summary collapse
- SINGLE_CHARACTER =
'N'
- LABEL =
"Notification"
Constants included from Util::BacktraceFilter
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.
-
#test_name ⇒ Object
readonly
Returns the value of attribute test_name.
Instance Method Summary collapse
- #critical? ⇒ Boolean
-
#initialize(test_name, location, message) ⇒ Notification
constructor
Creates a new Notification 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 notification.
-
#to_s ⇒ Object
Overridden to return long_display.
Methods included from Util::BacktraceFilter
Constructor Details
#initialize(test_name, location, message) ⇒ Notification
Creates a new Notification with the given location and message.
14 15 16 17 18 |
# File 'lib/test/unit/notification.rb', line 14 def initialize(test_name, location, ) @test_name = test_name @location = location @message = end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/test/unit/notification.rb', line 7 def location @location end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/test/unit/notification.rb', line 7 def @message end |
#test_name ⇒ Object (readonly)
Returns the value of attribute test_name.
7 8 9 |
# File 'lib/test/unit/notification.rb', line 7 def test_name @test_name end |
Instance Method Details
#critical? ⇒ Boolean
45 46 47 |
# File 'lib/test/unit/notification.rb', line 45 def critical? false end |
#label ⇒ Object
25 26 27 |
# File 'lib/test/unit/notification.rb', line 25 def label LABEL end |
#long_display ⇒ Object
Returns a verbose version of the error description.
35 36 37 38 |
# File 'lib/test/unit/notification.rb', line 35 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.
30 31 32 |
# File 'lib/test/unit/notification.rb', line 30 def short_display "#{@test_name}: #{@message.split("\n")[0]}" end |
#single_character_display ⇒ Object
Returns a single character representation of a notification.
21 22 23 |
# File 'lib/test/unit/notification.rb', line 21 def single_character_display SINGLE_CHARACTER end |
#to_s ⇒ Object
Overridden to return long_display.
41 42 43 |
# File 'lib/test/unit/notification.rb', line 41 def to_s long_display end |