Skip to content

Instantly share code, notes, and snippets.

@lucassus
lucassus / backtrace.txt
Created April 22, 2011 16:07
InheritedResources and RSpec mock_model
(rdb:1) ap e.backtrace
[
[ 0] "/home/lucassus/Projects/sample_project/vendor/gems/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_dispatch/routing/polymorphic_routes.rb:114:in `polymorphic_url'",
[ 1] "/home/lucassus/Projects/sample_project/vendor/gems/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_dispatch/routing/url_for.rb:133:in `url_for'",
[ 2] "/home/lucassus/Projects/sample_project/vendor/gems/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_controller/metal/redirecting.rb:89:in `_compute_redirect_to_location'",
[ 3] "/home/lucassus/Projects/sample_project/vendor/gems/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_controller/metal/redirecting.rb:61:in `redirect_to'",
[ 4] "/home/lucassus/Projects/sample_project/vendor/gems/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_controller/metal/flash.rb:25:in `redirect_to'",
[ 5] "/home/lucassus/Projects/sample_project/vendor/gems/ruby/1.9.1/gems/actionpack-3.0.4/lib/action_controller/metal/instrumentation.rb:60:in `block in redirect_to'",
[ 6] "/hom
@lucassus
lucassus / dates_spec.rb
Created April 14, 2011 14:32
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 ;)