Rspec shows negative time

I run rails 3.2.1 from rspec 2.8.1 on ruby ​​1.9.3p0, and when I run my tests it shows a negative time value. This is annoying as I try to optimize my tests.

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

Finished in -7603162.49414 seconds

I tried updating rspec to 2.9.0, but that did not help.

+5
source share
2 answers

Do you use timecop gem? After freezing, make sure you are Timecop.return. Either that, or you knock the date / time method somewhere.

+12
source

As a workaround you can do

time rspec filename.rb

But this will show the time required to launch the ruby, as well as how long the tests passed.

0
source

All Articles