Skip to content

Instantly share code, notes, and snippets.

@lucassus
Created April 14, 2011 14:32
Show Gist options
  • Save lucassus/919586 to your computer and use it in GitHub Desktop.
Save lucassus/919586 to your computer and use it in GitHub Desktop.
Difference between Dolorean and simple stub
context "for time just before the end time" do
before { Delorean.time_travel_to Time.parse('2011-04-03 23:58') } # two minutes to midnight ;)
after { Delorean.back_to_the_present }
it { should_not be_ended }
end
# ..and without magic DLS
context "for time just before the end time" do
before { Time.stubs(:now).returns(Time.parse('2011-04-03 23:58')) } # two minutes to midnight ;)
it { should_not be_ended }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment