diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-09 00:06:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-09 00:12:54 +0900 |
commit | ad3f7a3667d79a7d23c78e026d3eb5a42bd0b7b3 (patch) | |
tree | 02b716c3034207989fbf72e1f7766cee31171230 /test/ruby | |
parent | a206738762ea788830e8b3ac58b37d705595a6fb (diff) | |
download | ruby-ad3f7a3667d79a7d23c78e026d3eb5a42bd0b7b3.tar.gz |
Should require without wrapper module
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_require.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 2504b9e67c..6c4b97d08d 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -384,6 +384,19 @@ class TestRequire < Test::Unit::TestCase } end + def test_require_in_wrapped_load + Dir.mktmpdir do |tmp| + File.write("#{tmp}/1.rb", "require_relative '2'\n") + File.write("#{tmp}/2.rb", "class Foo\n""end\n") + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + path = ""#{tmp.dump}"/1.rb" + begin; + load path, true + assert_instance_of(Class, Foo) + end; + end + end + def test_load_scope bug1982 = '[ruby-core:25039] [Bug #1982]' Tempfile.create(["test_ruby_test_require", ".rb"]) {|t| |