spec/date_parser_spec.rb in sugarcube-1.4.3 vs spec/date_parser_spec.rb in sugarcube-1.4.4
- old
+ new
@@ -5,10 +5,15 @@
t = SugarCube::DateParser.parse_date("tomorrow at 7:30 PM")
t.should.is_a Time
t.hour.should == 19
t.min.should == 30
t.sec.should == 0
- (t.day - today.day).should == 1
+
+ if (today + 1.day).day == 1
+ t.day.should == 1
+ else
+ (t.day - today.day).should == 1
+ end
end
it "parses a specific natural language string, returning a date" do
t = SugarCube::DateParser.parse_date("6/18/13 at 7:30 AM")
t.month.should == 6
\ No newline at end of file