1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/test/unit/assertions.rb (assert_respond_to): gets rid of

overcounting.   [ruby-dev:37703]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-01-30 02:03:32 +00:00
parent e0469eea59
commit e501209104
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Fri Jan 30 11:03:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/assertions.rb (assert_respond_to): gets rid of
overcounting. [ruby-dev:37703]
Fri Jan 30 02:55:56 2009 Tanaka Akira <akr@fsij.org>
* transcode.c (rb_econv_init_by_convpath_i): make it static.

View file

@ -113,6 +113,11 @@ EOT
assert(!actual.equal?(expected), msg)
end
# get rid of overcounting
def assert_respond_to obj, meth, msg = nil
super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth)
end
def build_message(head, template=nil, *arguments)
template &&= template.chomp
template.gsub(/\?/) { mu_pp(arguments.shift) }