Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rspec shows negative time

Tags:

time

ruby

rspec

I'm running rails 3.2.1 with rspec 2.8.1 on ruby 1.9.3p0 and when running my tests it shows a negative time value. This is annoying as I'm trying optimise my tests.

Running: spec/models/transaction_spec.rb
................................................

Finished in -7603162.49414 seconds

I've tried updating rspec to 2.9.0 but this didn't help.

like image 940
map7 Avatar asked Mar 28 '12 01:03

map7


1 Answers

Are you using the timecop gem? Make sure you Timecop.return after freezing. Either that or you're stubbing a date/time method somewhere.

like image 76
Austin Avatar answered Nov 09 '22 15:11

Austin