summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 18:58:23 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 18:58:23 +0000
commit3c61aab98b22d5224adad020788f8f656f528f66 (patch)
tree55d11f61d8f3951397129b8497d63af309a59766 /test
parent49e1e456dca3a29ce6fcb7acc9d77397d2b08461 (diff)
merge revision(s) 56559,56582,56584,56585: [Backport #12903]
* test/ruby/test_file.rb (TestFile#test_stat): fix noatime case. [ruby-core:77943] [Bug #12903] * ext/-test/file/fs.c (get_atime_p): Updating of file access times is enabled or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@56789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 601d19efcd..845feb4349 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -1,6 +1,7 @@
require 'test/unit'
require 'tempfile'
require "thread"
+require "-test-/file"
require_relative 'ut_eof'
class TestFile < Test::Unit::TestCase
@@ -323,6 +324,7 @@ class TestFile < Test::Unit::TestCase
sleep 2
File.write(path, "bar")
sleep 2
+ File.read(path)
File.chmod(0644, path)
sleep 2
File.read(path)
@@ -334,7 +336,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 /mswin|mingw/ !~ RUBY_PLATFORM && !Bug::File::Fs.noatime?(path)
# Windows delays updating atime
assert_in_delta t0+6, stat.atime.to_f, delta
end