From 395da04aa6d2c8043b82b257a76aecba48dac755 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA 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/datetime/strftime_spec.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'spec/ruby/library/datetime/strftime_spec.rb') 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 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.3