Sha256: 0a7124f1518e7e12b6bc9049853c3cd567f6e11e77c5e90e8fb03dc8223ea192
Contents?: true
Size: 775 Bytes
Versions: 40
Compression:
Stored size: 775 Bytes
Contents
describe "Base Methods" do it "parses a relative natural language string, returning a date" do today = Time.now 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 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 t.day.should == 18 t.year.should == 2013 t.hour.should == 7 t.min.should == 30 end end describe "String Extensions" do it "parses a date the same as the base method" do "tomorrow at 7:30 PM".to_date.should == SugarCube::DateParser.parse_date("tomorrow at 7:30 PM") end end
Version data entries
40 entries across 40 versions & 1 rubygems