diff options
Diffstat (limited to 'test/ruby/test_file.rb')
-rw-r--r-- | test/ruby/test_file.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 58a4240391..bb366ce81f 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -468,4 +468,16 @@ class TestFile < Test::Unit::TestCase assert_file.not_exist?(path) end end + + def test_open_tempfile_path + Dir.mktmpdir(__method__.to_s) do |tmpdir| + File.open(tmpdir, File::RDWR | File::TMPFILE) do |io| + io.write "foo" + io.flush + assert_equal 3, io.size + assert_raise(IOError) { io.path } + end + end + end if File::Constants.const_defined?(:TMPFILE) + end |