diff options
Diffstat (limited to 'test/ruby/test_file.rb')
-rw-r--r-- | test/ruby/test_file.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index bb366ce81f..a184d3403c 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -471,12 +471,18 @@ class TestFile < Test::Unit::TestCase 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 } + begin + io = File.open(tmpdir, File::RDWR | File::TMPFILE) + rescue Errno::EINVAL + skip 'O_TMPFILE not supported (EINVAL)' end + + io.write "foo" + io.flush + assert_equal 3, io.size + assert_raise(IOError) { io.path } + ensure + io&.close end end if File::Constants.const_defined?(:TMPFILE) |