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
This commit is contained in:
parent
120e2219f3
commit
49a22e173b
@ -250,7 +250,13 @@ EOT
|
|||||||
#
|
#
|
||||||
# assert_respond_to("hello", :reverse) #Succeeds
|
# assert_respond_to("hello", :reverse) #Succeeds
|
||||||
# assert_respond_to("hello", :does_not_exist) #Fails
|
# 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
|
#get rid of overcounting
|
||||||
super if !caller[0].rindex(MINI_DIR, 0) || !obj.respond_to?(meth)
|
super if !caller[0].rindex(MINI_DIR, 0) || !obj.respond_to?(meth)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user