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

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -