1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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