From 0d9608eb3cc4d15c82692781cb608ce15c13c41d Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 15 May 2012 14:54:12 +0000 Subject: [PATCH] test/ruby/test_file.rb: use tmpdir * test/ruby/test_file.rb (TestFile#test_utime): Dir.mktmpdir does not chdir. * test/ruby/test_file.rb (TestFile#test_file_open_permissions): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_file.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 68dc7c1a1d..2e5979f53f 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -207,7 +207,8 @@ class TestFile < Test::Unit::TestCase def test_file_open_permissions Dir.mktmpdir(__method__.to_s) do |tmpdir| - File.open('x', :mode => IO::RDWR | IO::CREAT | IO::BINARY, + tmp = File.join(tmpdir, 'x') + File.open(tmp, :mode => IO::RDWR | IO::CREAT | IO::BINARY, :encoding => Encoding::ASCII_8BIT) do |x| assert x.autoclose? @@ -229,7 +230,8 @@ class TestFile < Test::Unit::TestCase def test_conflicting_encodings Dir.mktmpdir(__method__.to_s) do |tmpdir| - File.open('x', 'wb', :encoding => Encoding::EUC_JP) do |x| + tmp = File.join(tmpdir, 'x') + File.open(tmp, 'wb', :encoding => Encoding::EUC_JP) do |x| assert_equal Encoding::EUC_JP, x.external_encoding end end