Skip to content

Commit

Permalink
Merge pull request #1109 from herwinw/date_parse
Browse files Browse the repository at this point in the history
Fix descriptions for Date.parse specs
  • Loading branch information
andrykonchin authored Nov 12, 2023
2 parents b4e426c + ff22456 commit 49c26cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions library/date/shared/parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
d.day.should == 23
end

it "can parse a 'mmm DD YYYY' string into a Date object" do
it "can parse a 'DD mmm YYYY' string into a Date object" do
d = Date.parse("23#{@sep}feb#{@sep}2008")
d.year.should == 2008
d.month.should == 2
Expand Down Expand Up @@ -42,7 +42,7 @@
d.should == Date.civil(2005, 11, 5)
end

it "can parse a year, day and month name into a Date object" do
it "can parse a day, month name and year into a Date object" do
d = Date.parse("5th#{@sep}november#{@sep}2005")
d.should == Date.civil(2005, 11, 5)
end
Expand Down
8 changes: 4 additions & 4 deletions library/date/shared/parse_eu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@
d.day.should == 1
end

it "can parse a MM-DD-YYYY string into a Date object" do
it "can parse a DD-MM-YYYY string into a Date object" do
d = Date.parse("10#{@sep}01#{@sep}2007")
d.year.should == 2007
d.month.should == 1
d.day.should == 10
end

it "can parse a MM-DD-YY string into a Date object" do
it "can parse a YY-MM-DD string into a Date object" do
d = Date.parse("10#{@sep}01#{@sep}07")
d.year.should == 2010
d.month.should == 1
d.day.should == 7
end

it "can parse a MM-DD-YY string into a Date object NOT using the year digits as 20XX" do
it "can parse a YY-MM-DD string into a Date object NOT using the year digits as 20XX" do
d = Date.parse("10#{@sep}01#{@sep}07", false)
d.year.should == 10
d.month.should == 1
d.day.should == 7
end

it "can parse a MM-DD-YY string into a Date object using the year digits as 20XX" do
it "can parse a YY-MM-DD string into a Date object using the year digits as 20XX" do
d = Date.parse("10#{@sep}01#{@sep}07", true)
d.year.should == 2010
d.month.should == 1
Expand Down
8 changes: 4 additions & 4 deletions library/date/shared/parse_us.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
d.day.should == 1
end

it "parses a MM#{@sep}DD#{@sep}YYYY string into a Date object" do
it "parses a DD#{@sep}MM#{@sep}YYYY string into a Date object" do
d = Date.parse("10#{@sep}01#{@sep}2007")
d.year.should == 2007
d.month.should == 1
d.day.should == 10
end

it "parses a MM#{@sep}DD#{@sep}YY string into a Date object" do
it "parses a YY#{@sep}MM#{@sep}DD string into a Date object" do
d = Date.parse("10#{@sep}01#{@sep}07")
d.year.should == 2010
d.month.should == 1
d.day.should == 7
end

it "parses a MM#{@sep}DD#{@sep}YY string into a Date object NOT using the year digits as 20XX" do
it "parses a YY#{@sep}MM#{@sep}DD string into a Date object NOT using the year digits as 20XX" do
d = Date.parse("10#{@sep}01#{@sep}07", false)
d.year.should == 10
d.month.should == 1
d.day.should == 7
end

it "parses a MM#{@sep}DD#{@sep}YY string into a Date object using the year digits as 20XX" do
it "parses a YY#{@sep}MM#{@sep}DD string into a Date object using the year digits as 20XX" do
d = Date.parse("10#{@sep}01#{@sep}07", true)
d.year.should == 2010
d.month.should == 1
Expand Down

0 comments on commit 49c26cf

Please sign in to comment.