1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test for Bug #6385

* test/ruby/test_file.rb (TestFile#test_utime): test for [Bug #6385].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-05-15 14:54:15 +00:00
parent 0d9608eb3c
commit b32388d5f8

View file

@ -196,6 +196,26 @@ class TestFile < Test::Unit::TestCase
EOS
end
def test_utime
bug6385 = '[ruby-core:44776]'
mod_time_contents = Time.at 1306527039
file = Tempfile.new("utime")
file.close
path = file.path
File.utime(File.atime(path), mod_time_contents, path)
stats = File.stat(path)
file.open
file_mtime = file.mtime
file.close(true)
assert_equal(mod_time_contents, file_mtime, bug6385)
assert_equal(mod_time_contents, stats.mtime, bug6385)
end
def test_chmod_m17n
bug5671 = '[ruby-dev:44898]'
Dir.mktmpdir('test-file-chmod-m17n-') do |tmpdir|