Last Updated: February 25, 2016
·
490
· rgeyer

Use Kernel.sleep() rather than sleep() so that you can flexmock it.

Don't do this

sleep(10)

Instead do this

Kernel.sleep(10)

So that you can do this

it 'can skip sleeping when testing' do
  flexmock(Kernel).should_receive(:sleep)
end