mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added just working Test::Unit::CoreAssertions#diff
This is not "diff", but show expected and actual results both, just to get rid of `NoMethodError` when an assertion failed.
This commit is contained in:
parent
d52dffd817
commit
9fbbbadc96
1 changed files with 16 additions and 0 deletions
|
@ -635,6 +635,22 @@ eom
|
|||
super
|
||||
end
|
||||
end
|
||||
|
||||
def diff(exp, act)
|
||||
require 'pp'
|
||||
q = PP.new(+"")
|
||||
q.guard_inspect_key do
|
||||
q.group(2, "expected: ") do
|
||||
q.pp exp
|
||||
end
|
||||
q.text q.newline
|
||||
q.group(2, "actual: ") do
|
||||
q.pp act
|
||||
end
|
||||
q.flush
|
||||
end
|
||||
q.output
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue