merge revision(s) 33784:

* test/unit/assertions.rb (MINI_DIR): quick dirty hack to get rid of
	  warnings when using assert/assert_respond_to.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-02-06 12:21:54 +00:00
parent 7e82751c42
commit d95723ea9d
3 changed files with 10 additions and 3 deletions

View file

@ -10,6 +10,8 @@ module Test
obj.pretty_inspect.chomp
end
MINI_DIR = File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), "minitest") #:nodoc:
UNASSIGNED = Object.new # :nodoc:
# :call-seq:
@ -30,7 +32,7 @@ module Test
msg = nil
when String, Proc
else
bt = caller.reject { |s| s.rindex(MiniTest::MINI_DIR, 0) }
bt = caller.reject { |s| s.rindex(MINI_DIR, 0) }
raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
end
super
@ -250,7 +252,7 @@ EOT
# assert_respond_to("hello", :does_not_exist) #Fails
def assert_respond_to obj, meth, msg = nil
#get rid of overcounting
super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth)
super if !caller[0].rindex(MINI_DIR, 0) || !obj.respond_to?(meth)
end
ms = instance_methods(true).map {|sym| sym.to_s }