summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_dir.rb4
-rw-r--r--test/ruby/test_file_exhaustive.rb2
-rw-r--r--test/ruby/test_require.rb2
-rw-r--r--test/ruby/test_rubyoptions.rb12
4 files changed, 12 insertions, 8 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 44c9b7c5f7..33d83cbca3 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -224,7 +224,7 @@ class TestDir < Test::Unit::TestCase
File.symlink(File.join(@root, f),
File.join(@root, "symlink-#{ f }"))
end
- rescue NotImplementedError
+ rescue NotImplementedError, Errno::EACCES
return
end
@@ -303,7 +303,7 @@ class TestDir < Test::Unit::TestCase
Dir.chdir(dirname) do
begin
File.symlink('some-dir', 'dir-symlink')
- rescue NotImplementedError
+ rescue NotImplementedError, Errno::EACCES
return
end
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index b36b6168ee..e4b92152e5 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -110,7 +110,7 @@ class TestFileExhaustive < Test::Unit::TestCase
@symlinkfile = make_tmp_filename("symlinkfile")
begin
File.symlink(regular_file, @symlinkfile)
- rescue NotImplementedError
+ rescue NotImplementedError, Errno::EACCES
@symlinkfile = nil
end
@symlinkfile
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 1d70e39605..25116e4912 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -403,7 +403,7 @@ class TestRequire < Test::Unit::TestCase
File.symlink("../a/tst.rb", "b/tst.rb")
result = IO.popen([EnvUtil.rubybin, "b/tst.rb"], &:read)
assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]")
- rescue NotImplementedError
+ rescue NotImplementedError, Errno::EACCES
skip "File.symlink is not implemented"
end
}
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index ef9a8f257e..efdaeed237 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -437,10 +437,14 @@ class TestRubyOptions < Test::Unit::TestCase
}
if File.respond_to? :symlink
n2 = File.join(d, 't2')
- File.symlink(n1, n2)
- IO.popen([ruby, n2]) {|f|
- assert_equal(n2, f.read)
- }
+ begin
+ File.symlink(n1, n2)
+ rescue Errno::EACCES
+ else
+ IO.popen([ruby, n2]) {|f|
+ assert_equal(n2, f.read)
+ }
+ end
end
Dir.chdir(d) {
n3 = '-e'