spec/nsdate_spec.rb in sugarcube-1.5.9 vs spec/nsdate_spec.rb in sugarcube-1.6.0
- old
+ new
@@ -99,9 +99,22 @@
it "should have an NSDate#string_with_format method (:iso8601)" do
@date.string_with_format(:iso8601).should == '2013-01-02 12:15:30.000'
end
+ it "should have an NSDate#string_with_format method (:iso8601) and timezone" do
+ date = @date + @date.utc_offset
+ date.string_with_format(:iso8601, timezone:"UTC".nstimezone).should == '2013-01-02 12:15:30.000'
+ end
+
+ it "should have an NSDate#string_with_format method (:ymd)" do
+ @date.string_with_format(:ymd).should == '2013-01-02'
+ end
+
+ it "should have an NSDate#string_with_format method (:hms)" do
+ @date.string_with_format(:hms).should == '12:15:30.000'
+ end
+
it "should have an NSDate#timezone method" do
String.should === @date.timezone.name
end
it "should have an NSDate#era method" do