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

* io.c (rb_io_open_with_args): use rb_open_file instead of rb_io_open.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-20 11:33:36 +00:00
parent 9074da1b44
commit 65370097cd
3 changed files with 26 additions and 12 deletions

View file

@ -1225,4 +1225,22 @@ class TestIO < Test::Unit::TestCase
def test_uninitialized
assert_raise(IOError) { IO.allocate.print "" }
end
def test_nofollow
return unless defined? File::NOFOLLOW
mkcdtmpdir {
open("file", "w") {|f| f << "content" }
begin
File.symlink("file", "slnk")
rescue NotImplementedError
return
end
assert_raise(Errno::ELOOP) {
open("slnk", File::RDONLY|File::NOFOLLOW) {}
}
assert_raise(Errno::ELOOP) {
File.foreach("slnk", :open_args=>[File::RDONLY|File::NOFOLLOW]) {}
}
}
end
end