class Test::Unit::TestFailure

Public Instance Methods

test_display() click to toggle source
# File test-unit-3.3.4/test/test-failure.rb, line 10
    def test_display
      f = Failure.new("name", [%q{location:1 in 'l'}], "message1\nmessage2")
      assert_equal("name: message1", f.short_display)
      assert_equal(<<EOM.strip, f.long_display)
Failure:
name [location:1]:
message1
message2
EOM

      f = Failure.new("name", [%q{location1:2 in 'l1'}, 'location2:1', %q{location3:3 in 'l3'}], "message1\nmessage2")
      assert_equal("name: message1", f.short_display)
      assert_equal(<<EOM.strip, f.long_display)
Failure:
name
    [location1:2 in 'l1'
     location2:1
     location3:3 in 'l3']:
message1
message2
EOM
    end