aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-20 11:33:36 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-20 11:33:36 +0000
commit65370097cda754090f57da3d9df85f98c7725e50 (patch)
tree39707e7c5952c7913bc7cf665b71b3169b51e13f /test
parent9074da1b4424b09916d4baf23b26c7cfae75ac44 (diff)
downloadruby-65370097cda754090f57da3d9df85f98c7725e50.tar.gz
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 3d1dada06c..a181b41023 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -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