From e501209104a6dbce00fbaec6206c7c6edf3c3e55 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 30 Jan 2009 02:03:32 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ lib/test/unit/assertions.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4f563ab279..670874d378 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 30 11:03:31 2009 Nobuyoshi Nakada + + * lib/test/unit/assertions.rb (assert_respond_to): gets rid of + overcounting. [ruby-dev:37703] + Fri Jan 30 02:55:56 2009 Tanaka Akira * transcode.c (rb_econv_init_by_convpath_i): make it static. diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index ac3ecf93c7..1358443285 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -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) }