Skip to content

Commit

Permalink
Add Windows guard
Browse files Browse the repository at this point in the history
* It seems Windows only has microseconds resolution.
  • Loading branch information
eregon committed Oct 5, 2021
1 parent 9dbd8d1 commit ccf0d85
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/file/utime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@
end
end

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
platform_is_not :windows 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
end
end

platform_is :linux do
Expand Down

0 comments on commit ccf0d85

Please sign in to comment.