QuantumLeap

Righting wrongs in your test suite with time travel!

View the Project on GitHub mattonrails/quantum_leap

QuantumLeap lets you change the current time in your tests.

I can't promise you'll meet any historical figures, however.

Installation

Add this line to your application's Gemfile:

gem 'quantum_leap'

Or install it yourself as:

$ gem install quantum_leap

Usage

Quantum.leap(Time.new(1956, 9, 13))
sam.must_be_kind_of(Pilot)
sam.must_win_baseball_game
Quantum.leap_back

Or with a block:

Quantum.leap(Time.new(1974, 10, 24)) do
  sam.must_be_kind_of(Boxer)
  sam.must_win_the_championship
end

Defaults to Time.now without arguments:

Time.now
=> 2012-05-31 21:25:34 -0400
Quantum.leap
Time.now
=> 2012-05-31 21:25:36 -0400