зеркало из https://github.com/github/ruby.git
* lib/test/unit.rb (assert_equal): failure message changed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0ebf9b1763
Коммит
338253cbe5
|
@ -1,3 +1,7 @@
|
|||
Thu Oct 16 23:23:27 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/test/unit.rb (assert_equal): failure message changed.
|
||||
|
||||
Thu Oct 16 22:52:54 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/test/unit: removed test/unit.
|
||||
|
|
|
@ -89,7 +89,22 @@ module Test
|
|||
end
|
||||
|
||||
def assert_equal(exp, act, msg = nil)
|
||||
msg = message(msg) { "Expected\n<#{mu_pp(exp)}> but\n<#{mu_pp(act)}>" }
|
||||
msg = message(msg) {
|
||||
exp_str = mu_pp(exp)
|
||||
act_str = mu_pp(act)
|
||||
exp_comment = ''
|
||||
act_comment = ''
|
||||
if exp_str == act_str
|
||||
if exp.is_a?(String) && act.is_a?(String)
|
||||
exp_comment = " (#{exp.encoding})"
|
||||
act_comment = " (#{act.encoding})"
|
||||
elsif exp.is_a?(Time) && act.is_a?(Time)
|
||||
exp_comment = " (nsec=#{exp.nsec})"
|
||||
act_comment = " (nsec=#{act.nsec})"
|
||||
end
|
||||
end
|
||||
"<#{exp_str}>#{exp_comment} expected but was\n<#{act_str}>#{act_comment}"
|
||||
}
|
||||
assert(exp == act, msg)
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче