[前][次][番号順一覧][スレッド一覧]

ruby-changes:60637

From: Nobuyoshi <ko1@a...>
Date: Fri, 3 Apr 2020 10:37:00 +0900 (JST)
Subject: [ruby-changes:60637] ca0f68260e (master): Use `platform_is` guard

https://git.ruby-lang.org/ruby.git/commit/?id=ca0f68260e

From ca0f68260ee930100dc39f8c4647ce56663f17fe Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 3 Apr 2020 09:47:19 +0900
Subject: Use `platform_is` guard


diff --git a/spec/ruby/core/file/atime_spec.rb b/spec/ruby/core/file/atime_spec.rb
index b9b5db8..5663e47 100644
--- a/spec/ruby/core/file/atime_spec.rb
+++ b/spec/ruby/core/file/atime_spec.rb
@@ -15,7 +15,7 @@ describe "File.atime" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/atime_spec.rb#L15
     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)
diff --git a/spec/ruby/core/file/ctime_spec.rb b/spec/ruby/core/file/ctime_spec.rb
index fff74b1..b16eb13 100644
--- a/spec/ruby/core/file/ctime_spec.rb
+++ b/spec/ruby/core/file/ctime_spec.rb
@@ -14,7 +14,7 @@ describe "File.ctime" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/ctime_spec.rb#L14
     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
diff --git a/spec/ruby/core/file/mtime_spec.rb b/spec/ruby/core/file/mtime_spec.rb
index 02f6fc4..8d47d30 100644
--- a/spec/ruby/core/file/mtime_spec.rb
+++ b/spec/ruby/core/file/mtime_spec.rb
@@ -15,7 +15,7 @@ describe "File.mtime" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/mtime_spec.rb#L15
     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
diff --git a/spec/ruby/core/file/utime_spec.rb b/spec/ruby/core/file/utime_spec.rb
index d703681..96627b1 100644
--- a/spec/ruby/core/file/utime_spec.rb
+++ b/spec/ruby/core/file/utime_spec.rb
@@ -3,7 +3,7 @@ require_relative '../../spec_helper' https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/utime_spec.rb#L3
 describe "File.utime" do
 
   before :all do
-    @time_is_float = /mswin|mingw/ =~ RUBY_PLATFORM
+    @time_is_float = platform_is :windows
   end
 
   before :each do
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]