diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-18 04:21:23 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-18 04:21:23 +0000 |
commit | 7491541e1602d2cf9b29783abadf802f1f50251c (patch) | |
tree | ec756fd2d6a2b321d82d35420c6934ab23b59b18 /lib/test | |
parent | 44cff77b95104cc99ea5625df6ebe8adfa3f4a22 (diff) | |
download | ruby-7491541e1602d2cf9b29783abadf802f1f50251c.tar.gz |
* 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/trunk@33784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test')
-rw-r--r-- | lib/test/unit/assertions.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 157cbac743..49987fab57 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -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 # :call-seq: |