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

ruby-changes:68163

From: Hiroshi <ko1@a...>
Date: Tue, 28 Sep 2021 19:16:04 +0900 (JST)
Subject: [ruby-changes:68163] 395da04aa6 (master): Followed up ruby/spec examples for date.

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

From 395da04aa6d2c8043b82b257a76aecba48dac755 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Tue, 28 Sep 2021 19:14:02 +0900
Subject: Followed up ruby/spec examples for date.

  https://github.com/ruby/ruby/commit/f9f7f3a75ec5af4a70e3332f8f5aa300c13432e2
---
 spec/ruby/library/date/strftime_spec.rb     | 15 ++++++++++++---
 spec/ruby/library/datetime/strftime_spec.rb | 15 ++++++++++++---
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/spec/ruby/library/date/strftime_spec.rb b/spec/ruby/library/date/strftime_spec.rb
index 9d298e42e6..8b1ebe061c 100644
--- a/spec/ruby/library/date/strftime_spec.rb
+++ b/spec/ruby/library/date/strftime_spec.rb
@@ -22,9 +22,18 @@ describe "Date#strftime" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/date/strftime_spec.rb#L22
   end
 
   # %v is %e-%b-%Y for Date/DateTime
-  it "should be able to show the commercial week" do
-    @date.strftime("%v").should == " 9-Apr-2000"
-    @date.strftime("%v").should == @date.strftime('%e-%b-%Y')
+  ruby_version_is ""..."3.1" do
+    it "should be able to show the commercial week" do
+      @date.strftime("%v").should == " 9-Apr-2000"
+      @date.strftime("%v").should == @date.strftime('%e-%b-%Y')
+    end
+  end
+
+  ruby_version_is "3.1" do
+    it "should be able to show the commercial week" do
+      @date.strftime("%v").should == " 9-APR-2000"
+      @date.strftime("%v").should != @date.strftime('%e-%b-%Y')
+    end
   end
 
   # additional conversion specifiers only in Date/DateTime
diff --git a/spec/ruby/library/datetime/strftime_spec.rb b/spec/ruby/library/datetime/strftime_spec.rb
index cf07bbf9de..725bcafb0d 100644
--- a/spec/ruby/library/datetime/strftime_spec.rb
+++ b/spec/ruby/library/datetime/strftime_spec.rb
@@ -33,9 +33,18 @@ describe "DateTime#strftime" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/datetime/strftime_spec.rb#L33
   end
 
   # %v is %e-%b-%Y for Date/DateTime
-  it "should be able to show the commercial week" do
-    @time.strftime("%v").should == " 3-Feb-2001"
-    @time.strftime("%v").should == @time.strftime('%e-%b-%Y')
+  ruby_version_is ""..."3.1" do
+    it "should be able to show the commercial week" do
+      @time.strftime("%v").should == " 3-Feb-2001"
+      @time.strftime("%v").should == @time.strftime('%e-%b-%Y')
+    end
+  end
+
+  ruby_version_is "3.1" do
+    it "should be able to show the commercial week" do
+      @time.strftime("%v").should == " 3-FEB-2001"
+      @time.strftime("%v").should != @time.strftime('%e-%b-%Y')
+    end
   end
 
   # additional conversion specifiers only in Date/DateTime
-- 
cgit v1.2.1


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

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