Skip to content

Commit ccf0d85

Browse files
committed
Add Windows guard
* It seems Windows only has microseconds resolution.
1 parent 9dbd8d1 commit ccf0d85

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/file/utime_spec.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@
7070
end
7171
end
7272

73-
it "sets nanosecond precision" do
74-
t = Time.utc(2007, 11, 1, 15, 25, 0, 123456.789r)
75-
File.utime(t, t, @file1)
76-
File.atime(@file1).nsec.should == 123456789
77-
File.mtime(@file1).nsec.should == 123456789
73+
platform_is_not :windows do
74+
it "sets nanosecond precision" do
75+
t = Time.utc(2007, 11, 1, 15, 25, 0, 123456.789r)
76+
File.utime(t, t, @file1)
77+
File.atime(@file1).nsec.should == 123456789
78+
File.mtime(@file1).nsec.should == 123456789
79+
end
7880
end
7981

8082
platform_is :linux do

0 commit comments

Comments
 (0)