From ddca0c66867b09106a835f28600edefac7e785ce Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 6 Oct 2021 11:38:47 +0900 Subject: Fix filesystem dependent tests Ruby cannot guarantee the resolutions of underlying filesystems. --- spec/ruby/core/file/utime_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/ruby/core/file') diff --git a/spec/ruby/core/file/utime_spec.rb b/spec/ruby/core/file/utime_spec.rb index 45a51490e4..dd8eeef489 100644 --- a/spec/ruby/core/file/utime_spec.rb +++ b/spec/ruby/core/file/utime_spec.rb @@ -74,8 +74,8 @@ describe "File.utime" do it "sets nanosecond precision" do t = Time.utc(2007, 11, 1, 15, 25, 0, 123456.789r) File.utime(t, t, @file1) - File.atime(@file1).nsec.should == 123456789 - File.mtime(@file1).nsec.should == 123456789 + File.atime(@file1).nsec.should.between?(0, 123500000) + File.mtime(@file1).nsec.should.between?(0, 123500000) end end -- cgit v1.2.3