aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index a1462c53b2..ea1dfc758c 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3555,6 +3555,14 @@ __END__
end
end if File::BINARY != 0
+ def test_exclusive_mode
+ make_tempfile do |t|
+ assert_raise(Errno::EEXIST){ open(t.path, 'wx'){} }
+ assert_raise(ArgumentError){ open(t.path, 'rx'){} }
+ assert_raise(ArgumentError){ open(t.path, 'ax'){} }
+ end
+ end
+
def test_race_gets_and_close
assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}")
bug13076 = '[ruby-core:78845] [Bug #13076]'