summaryrefslogtreecommitdiff
path: root/test/ruby/test_file.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-05 01:07:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-05 01:07:19 +0000
commitc71a60c1dd02cb92f21a4e1eec6f0cf526ffe790 (patch)
tree2256c34b98c0e68c006bcc1ffa984620d25af6fc /test/ruby/test_file.rb
parent0b8ab5b0a86bb6039dee2ed31501c9d135ee2fed (diff)
test_file.rb: fix noatime
* test/ruby/test_file.rb (TestFile#test_stat): fix noatime case. [ruby-core:77943] [Bug #12903] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_file.rb')
-rw-r--r--test/ruby/test_file.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index bd0e502f5b..67f6206931 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -358,6 +358,8 @@ class TestFile < Test::Unit::TestCase
sleep 2
File.write(path, "bar")
sleep 2
+ File.read(path)
+ a0 = File.stat(path).atime
File.chmod(0644, path)
sleep 2
File.read(path)
@@ -369,7 +371,7 @@ class TestFile < Test::Unit::TestCase
if stat.birthtime != stat.ctime
assert_in_delta t0+4, stat.ctime.to_f, delta
end
- unless /mswin|mingw/ =~ RUBY_PLATFORM
+ if a0 > stat.mtime
# Windows delays updating atime
assert_in_delta t0+6, stat.atime.to_f, delta
end