test O_NOFOLLOW only on FreeBSD and Linux.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-21 10:04:23 +00:00
parent a0e3fe5d7c
commit 3f7bed0b80

View File

@ -1255,6 +1255,8 @@ class TestIO < Test::Unit::TestCase
end end
def test_nofollow def test_nofollow
# O_NOFOLLOW is not standard.
return if /freebsd|linux/ !~ RUBY_PLATFORM
return unless defined? File::NOFOLLOW return unless defined? File::NOFOLLOW
mkcdtmpdir { mkcdtmpdir {
open("file", "w") {|f| f << "content" } open("file", "w") {|f| f << "content" }
@ -1263,10 +1265,10 @@ class TestIO < Test::Unit::TestCase
rescue NotImplementedError rescue NotImplementedError
return return
end end
assert_raise(Errno::ELOOP) { assert_raise(Errno::EMLINK, Errno::ELOOP) {
open("slnk", File::RDONLY|File::NOFOLLOW) {} open("slnk", File::RDONLY|File::NOFOLLOW) {}
} }
assert_raise(Errno::ELOOP) { assert_raise(Errno::EMLINK, Errno::ELOOP) {
File.foreach("slnk", :open_args=>[File::RDONLY|File::NOFOLLOW]) {} File.foreach("slnk", :open_args=>[File::RDONLY|File::NOFOLLOW]) {}
} }
} }