ruby on rails - Set time zone on one rspec test -
I'm trying to set the time zone on an RSPC test like this:
Zone = ActiveSupport :: TimeZone.new ('Hawaii') Time.stub (: now) {Time.now.in_time_zone (zone)} This gives me a stack level very deep error Gives, what am I missing here?
Try doing this:
Zone = ActiveSupport :: TimeZone.new ('Hawaii') Time.stub (: now) {Time.new.in_time_zone (zone)} I'm not sure, but it looks like Stubbing now and then there is a very serious error due to the stack level in the calling time.now block.
Comments
Post a Comment