summaryrefslogtreecommitdiff
path: root/test/ruby/test_autoload.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_autoload.rb')
-rw-r--r--test/ruby/test_autoload.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb
index b793fd2..b2d8d66 100644
--- a/test/ruby/test_autoload.rb
+++ b/test/ruby/test_autoload.rb
@@ -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