зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
498a001fa7
Коммит
0d9608eb3c
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче