You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error in ree 1.8.7 using Timecop 0.4.4 (or 0.4.1) and Rails 3.0. If I go back to Timecop 0.3.5 it works. It also works if I update to Ruby 1.9.3 (which unfortunately isn't an option for me at the moment). Have also tested this in a different Rails 3.2 project with the same results.
>> Timecop.freeze(Time.parse("2011-12-10 13:00-0400")) { puts DateTime.now }
NoMethodError: undefined method `to_r' for 61200.0:Float
from /Users/sean/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/date.rb:527:in `time_to_day_fraction'
from /Users/sean/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/date.rb:707:in `valid_time?'
from /Users/sean/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/date.rb:1521:in `new'
from /Users/sean/.rvm/gems/ree-1.8.7-2012.02/gems/timecop-0.4.1/lib/timecop/time_stack_item.rb:64:in `datetime'
from /Users/sean/.rvm/gems/ree-1.8.7-2012.02/gems/timecop-0.4.1/lib/timecop/time_extensions.rb:53:in `mock_time'
from /Users/sean/.rvm/gems/ree-1.8.7-2012.02/gems/timecop-0.4.1/lib/timecop/time_extensions.rb:66:in `now'
from (irb):1
from /Users/sean/.rvm/gems/ree-1.8.7-2012.02/gems/timecop-0.4.1/lib/timecop/timecop.rb:109:in `travel'
from /Users/sean/.rvm/gems/ree-1.8.7-2012.02/gems/timecop-0.4.1/lib/timecop/timecop.rb:49:in `send'
from /Users/sean/.rvm/gems/ree-1.8.7-2012.02/gems/timecop-0.4.1/lib/timecop/timecop.rb:49:in `freeze'
from (irb):1
>> Timecop.freeze(Time.parse("2011-12-10 13:00-0400")) { puts Time.now }
2011-12-10 17:00:00 UTC
The text was updated successfully, but these errors were encountered:
I get the following error in ree 1.8.7 using Timecop 0.4.4 (or 0.4.1) and Rails 3.0. If I go back to Timecop 0.3.5 it works. It also works if I update to Ruby 1.9.3 (which unfortunately isn't an option for me at the moment). Have also tested this in a different Rails 3.2 project with the same results.
The text was updated successfully, but these errors were encountered: