summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-30 02:03:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-30 02:03:32 +0000
commitef28337670bd8d8f4c0c74138de391b7504ecb72 (patch)
tree84302a9e97c137e904b3564892d110becee4bf0f /lib
parent27deaf183f122a22d617d331126756ad02328764 (diff)
downloadruby-ef28337670bd8d8f4c0c74138de391b7504ecb72.tar.gz
ruby-ef28337670bd8d8f4c0c74138de391b7504ecb72.tar.xz
ruby-ef28337670bd8d8f4c0c74138de391b7504ecb72.zip
* lib/test/unit/assertions.rb (assert_respond_to): gets rid of
overcounting. [ruby-dev:37703] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit/assertions.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index ac3ecf93c..135844328 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) }