[RSpec] Stubbing Time.now
A memo on code for stubbing Time.now in Ruby on Rails + RSpec.
time_now = Time.local(2013, 12, 31, 0, 0, 0) Time.stub!(:now).and_return(time_now)
That’s all from the Gemba.