mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* 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
This commit is contained in:
parent
44cff77b95
commit
7491541e16
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Nov 18 13:20:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/unit/assertions.rb (MINI_DIR): quick dirty hack to get rid of
|
||||||
|
warnings when using assert/assert_respond_to.
|
||||||
|
|
||||||
Fri Nov 18 13:03:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Nov 18 13:03:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it is
|
* io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it is
|
||||||
|
|
|
@ -10,6 +10,8 @@ module Test
|
||||||
obj.pretty_inspect.chomp
|
obj.pretty_inspect.chomp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
MINI_DIR = File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), "minitest") #:nodoc:
|
||||||
|
|
||||||
UNASSIGNED = Object.new # :nodoc:
|
UNASSIGNED = Object.new # :nodoc:
|
||||||
|
|
||||||
# :call-seq:
|
# :call-seq:
|
||||||
|
@ -30,7 +32,7 @@ module Test
|
||||||
msg = nil
|
msg = nil
|
||||||
when String, Proc
|
when String, Proc
|
||||||
else
|
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
|
raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
|
||||||
end
|
end
|
||||||
super
|
super
|
||||||
|
@ -250,7 +252,7 @@ EOT
|
||||||
# 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, msg = nil
|
||||||
#get rid of overcounting
|
#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
|
end
|
||||||
|
|
||||||
# :call-seq:
|
# :call-seq:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue