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

Followed up ruby/spec examples for date.

f9f7f3a75e
This commit is contained in:
Hiroshi SHIBATA 2021-09-28 19:14:02 +09:00
parent be51f4ce83
commit 395da04aa6
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 24 additions and 6 deletions

View file

@ -22,9 +22,18 @@ describe "Date#strftime" do
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

View file

@ -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