Skip to content

Commit

Permalink
Followed up ruby/spec examples for date.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and eregon committed Oct 5, 2021
1 parent 94d4897 commit 0cebeb0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
15 changes: 12 additions & 3 deletions library/date/strftime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
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
Expand Down
15 changes: 12 additions & 3 deletions library/datetime/strftime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@
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
Expand Down

0 comments on commit 0cebeb0

Please sign in to comment.