1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use platform_is guard

This commit is contained in:
Nobuyoshi Nakada 2020-04-03 09:47:19 +09:00
parent 18f7d3c9a6
commit ca0f68260e
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
Notes: git 2020-04-03 10:37:04 +09:00
4 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ describe "File.atime" do
File.atime(@file).should be_kind_of(Time)
end
guard -> { platform_is :linux or platform_is :windows } do
platform_is :linux, :windows do
## NOTE also that some Linux systems disable atime (e.g. via mount params) for better filesystem speed.
it "returns the last access time for the named file with microseconds" do
supports_subseconds = Integer(`stat -c%x '#{__FILE__}'`[/\.(\d+)/, 1], 10)

View file

@ -14,7 +14,7 @@ describe "File.ctime" do
File.ctime(@file).should be_kind_of(Time)
end
guard -> { platform_is :linux or platform_is :windows } do
platform_is :linux, :windows do
it "returns the change time for the named file (the time at which directory information about the file was changed, not the file itself) with microseconds." do
supports_subseconds = Integer(`stat -c%z '#{__FILE__}'`[/\.(\d+)/, 1], 10)
if supports_subseconds != 0

View file

@ -15,7 +15,7 @@ describe "File.mtime" do
File.mtime(@filename).should be_close(@mtime, TIME_TOLERANCE)
end
guard -> { platform_is :linux or platform_is :windows } do
platform_is :linux, :windows do
it "returns the modification Time of the file with microseconds" do
supports_subseconds = Integer(`stat -c%y '#{__FILE__}'`[/\.(\d+)/, 1], 10)
if supports_subseconds != 0

View file

@ -3,7 +3,7 @@ require_relative '../../spec_helper'
describe "File.utime" do
before :all do
@time_is_float = /mswin|mingw/ =~ RUBY_PLATFORM
@time_is_float = platform_is :windows
end
before :each do