summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 13:42:29 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 13:42:29 +0000
commite02f7f79c23aaaf7c5878408a2b46b00f23c32ba (patch)
tree39e7ec97e86e686d1fb1d42f23bd8b39fc452bef /test
parent4af243a8afa0dfefc74bb68dd08d9c5ff3ccc5d5 (diff)
* iseq.c (set_relation): do not use top_wrapper as bottom of cref,
which caused constant lookup error when "wrapped load" is used; instead, use Object as bottom, and push top_wrapper on Object. [ruby-core:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 458c61998f..fbe71a2db5 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -197,6 +197,19 @@ class TestRequire < Test::Unit::TestCase
assert_raise(ArgumentError) { at_exit }
end
+ def test_load2 # [ruby-core:25039]
+ t = Tempfile.new(["test_ruby_test_require", ".rb"])
+ t.puts "Hello = 'hello'"
+ t.puts "class Foo"
+ t.puts " p Hello"
+ t.puts "end"
+ t.close
+
+ assert_in_out_err([], <<-INPUT, %w("hello"), [])
+ load(#{ t.path.dump }, true)
+ INPUT
+ end
+
def test_tainted_loadpath
t = Tempfile.new(["test_ruby_test_require", ".rb"])
abs_dir, file = File.split(t.path)