6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/test-unit-ext/assertions.rb', line 6
def assert_equal(expected, actual, message=nil)
super
rescue AssertionFailedError
expected = PP.pp(expected, "") unless expected.is_a?(String)
actual = PP.pp(actual, "") unless actual.is_a?(String)
diff = Diff.readable(expected, actual)
if /^[\?\-\+].{79}/ =~ diff
folded_diff = Diff.readable(fold(expected), fold(actual))
diff = "#{diff}\n\nfolded diff:\n#{folded_diff}"
end
raise $!, "#{$!.message}\n\ndiff:\n#{diff}", $@
end
|