rubymotion-community / sugarcube

Some sugar for your cocoa. RubyMotion helpers.
Other
422 stars 66 forks source link

Spec failure in date_delta_spec.rb #35

Closed Watson1978 closed 11 years ago

Watson1978 commented 11 years ago

with latest sugarcube, I've seen sepc failure in date_delta_spec.rb when I run `rake spec' with RubyMotion v1.32.

Bacon::Error: 2013-03-10 14:00:00 +0900.==(2013-03-10 15:00:00 +0900) failed
    spec.rb:649:in `satisfy:': NSDate#delta - should handle daylight savings logically unless you assign an hour
    spec.rb:663:in `method_missing:'
    spec.rb:279:in `block in run_spec_block'
    spec.rb:403:in `execute_block'
    spec.rb:279:in `run_spec_block'
    spec.rb:294:in `run'

297 specifications (1151 requirements), 1 failures, 0 errors

The following changing might fix above.

diff --git a/spec/date_delta_spec.rb b/spec/date_delta_spec.rb
index 9f53c8f..7181c21 100644
--- a/spec/date_delta_spec.rb
+++ b/spec/date_delta_spec.rb
@@ -97,7 +97,7 @@ describe "NSDate#delta" do

   it "should handle daylight savings logically unless you assign an hour" do
     mar_10_2012 = NSDate.from_components(year:2013, month: 3, day: 9, hour: 13)
-    mar_10_2012.delta(days:1, hours: 1).should == NSDate.from_components(year:2013, month: 3, day: 10, hour: 15)
+    mar_10_2012.delta(days:1, hours: 1).should == NSDate.from_components(year:2013, month: 3, day: 10, hour: 14)
   end

 end

Thanks.

Watson1978 commented 11 years ago

I confirmed that this issue was fixed with https://github.com/rubymotion/sugarcube/commit/8f31582db47ce9b61bafc2dfa44f38c9acb67909

Thanks