mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby: suppress runtime warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
41f4317f45
commit
c7f815eed8
10 changed files with 36 additions and 29 deletions
|
@ -189,7 +189,9 @@ p Foo::Bar
|
|||
end
|
||||
|
||||
def ruby_impl_require
|
||||
Kernel.module_eval do; alias :old_require :require; end
|
||||
Kernel.module_eval do
|
||||
alias old_require require
|
||||
end
|
||||
called_with = []
|
||||
Kernel.send :define_method, :require do |path|
|
||||
called_with << path
|
||||
|
@ -197,7 +199,11 @@ p Foo::Bar
|
|||
end
|
||||
yield called_with
|
||||
ensure
|
||||
Kernel.module_eval do; alias :require :old_require; undef :old_require; end
|
||||
Kernel.module_eval do
|
||||
undef require
|
||||
alias require old_require
|
||||
undef old_require
|
||||
end
|
||||
end
|
||||
|
||||
def test_require_implemented_in_ruby_is_called
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue