summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-13 05:51:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-13 05:51:29 +0000
commit49a22e173b8d8e95eb3b891669329b8a07c43e70 (patch)
tree1fdab685f80e221085de23d0688e5f0e38a84387 /lib
parent120e2219f318241bb1a75a763cc37b42ccc9b772 (diff)
assertions.rb: private flag
* lib/test/unit/assertions.rb (assert_respond_to): accept optional include-private flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit/assertions.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index 7cfa243204..984d5be726 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -250,7 +250,13 @@ EOT
#
# assert_respond_to("hello", :reverse) #Succeeds
# assert_respond_to("hello", :does_not_exist) #Fails
- def assert_respond_to obj, meth, msg = nil
+ def assert_respond_to obj, (meth, priv), msg = nil
+ if priv
+ msg = message(msg) {
+ "Expected #{mu_pp(obj)} (#{obj.class}) to respond to ##{meth}#{" privately" if priv}"
+ }
+ return assert obj.respond_to?(meth, priv), msg
+ end
#get rid of overcounting
super if !caller[0].rindex(MINI_DIR, 0) || !obj.respond_to?(meth)
end