diff options
Diffstat (limited to 'test/ruby/test_require.rb')
| -rw-r--r-- | test/ruby/test_require.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index d108e08118..eed8e97da8 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -54,7 +54,7 @@ class TestRequire < Test::Unit::TestCase end; begin - assert_in_out_err(["-S", "-w", "foo/" * 1024 + "foo"], "") do |r, e| + assert_in_out_err(["-S", "-w", (["foo"] * 1025).join("_")], "") do |r, e| assert_equal([], r) assert_operator(2, :<=, e.size) assert_match(/warning: openpath: pathname too long \(ignored\)/, e.first) @@ -532,7 +532,7 @@ class TestRequire < Test::Unit::TestCase def test_frozen_loaded_features bug3756 = '[ruby-core:31913]' - assert_in_out_err(['-e', '$LOADED_FEATURES.freeze; require "ostruct"'], "", + assert_in_out_err(['-e', '$LOADED_FEATURES.freeze; require "erb"'], "", [], /\$LOADED_FEATURES is frozen; cannot append feature \(RuntimeError\)$/, bug3756) end @@ -842,7 +842,7 @@ class TestRequire < Test::Unit::TestCase } # [Bug #21567] - assert_separately(%w[-rtempfile], "#{<<~"begin;"}\n#{<<~"end;"}") + assert_ruby_status(%w[-rtempfile], "#{<<~"begin;"}\n#{<<~"end;"}") begin; class MyString def initialize(path) @@ -857,7 +857,13 @@ class TestRequire < Test::Unit::TestCase def to_path = @path end - def create_ruby_file = Tempfile.create(["test", ".rb"]).path + FILES = [] + + def create_ruby_file + file = Tempfile.open(["test", ".rb"]) + FILES << file + file.path + end require MyString.new(create_ruby_file) $LOADED_FEATURES.unshift(create_ruby_file) @@ -1023,7 +1029,7 @@ class TestRequire < Test::Unit::TestCase def test_require_with_public_method_missing # [Bug #19793] - assert_separately(["-W0", "-rtempfile"], __FILE__, __LINE__, <<~RUBY, timeout: 60) + assert_ruby_status(["-W0", "-rtempfile"], <<~RUBY, timeout: 60) GC.stress = true class Object |
