diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-03 17:11:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-03 17:11:43 +0000 |
commit | c24f12ec2aca64e8b3aaa0ce91b4b08f6c1a4023 (patch) | |
tree | 2e39257fd947b41ff8ee6c24cb7f7ee1cb5b4aa0 /test | |
parent | b5be909dddb8b1ebcc0ee5a65450085abe0bd3d3 (diff) | |
download | ruby-c24f12ec2aca64e8b3aaa0ce91b4b08f6c1a4023.tar.gz |
test_require.rb: ignore EPERM at UNC
* test/ruby/test_require.rb (test_require_with_unc): ignore EPERM.
GetFileAttributes and CreateFile with backup semantics fail at a
symlink in a shared folder to another shared folder.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_require.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 7dc7b4eb49..666f2fcd82 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -222,13 +222,20 @@ class TestRequire < Test::Unit::TestCase end def test_require_with_unc - ruby = File.expand_path(EnvUtil.rubybin).sub(/\A(\w):/, '//127.0.0.1/\1$/') - skip "local drive #$1: is not shared" unless File.exist?(ruby) - pid = nil - assert_nothing_raised {pid = spawn(ruby, "-rabbrev", "-e0")} - ret, status = Process.wait2(pid) - assert_equal(pid, ret) - assert_predicate(status, :success?) + Tempfile.create(["test_ruby_test_require", ".rb"]) {|t| + t.puts "puts __FILE__" + t.close + + path = File.expand_path(t.path).sub(/\A(\w):/, '//127.0.0.1/\1$/') + skip "local drive #$1: is not shared" unless File.exist?(path) + args = ['--disable-gems', "-I#{File.dirname(path)}"] + assert_in_out_err(args, "#{<<~"END;"}", [path], []) + begin + require '#{File.basename(path)}' + rescue Errno::EPERM + end + END; + } end if /mswin|mingw/ =~ RUBY_PLATFORM def test_require_twice |