Class: Test::Unit::Error
Instance Method Summary collapse
- #filter_rails_html(str) ⇒ Object
-
#long_display ⇒ Object
Returns a verbose version of the error description.
Instance Method Details
#filter_rails_html(str) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/extensions/test/unit/error.rb', line 12 def filter_rails_html(str) html = '<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Action Controller: Exception caught</title> <style> body { background-color: #fff; color: #333; } body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; } pre { background-color: #eee; padding: 10px; font-size: 11px; } a { color: #000; } a:visited { color: #666; } a:hover { color: #fff; background-color:#000; } </style> </head> <body> <h1>' out = str.gsub(html, '') out.split("\n")[0, 6].join("\n") + "..." end |
#long_display ⇒ Object
Returns a verbose version of the error description.
6 7 8 9 10 |
# File 'lib/extensions/test/unit/error.rb', line 6 def long_display backtrace = filter_backtrace(@exception.backtrace).join("\n ") "#{colorize('Error:', :red)}\n" + "#{colorize(filter_rails_html(), :red)}\n#{backtrace}" end |