Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def purchase send_shipping_notice end def send_shipping_notice puts "hi" end # In my spec def given_bought_on(date) wp = @restaurant.web_page puts wp.inspect wp.should_receive(:send_shipping_notice) wp.purchase end # Outputs: #<WebPage id: 270, owner_id: 270, name: nil, ......> receipt: #<RestaurantReceipt id: 420, restaurant_id: 1041, user_id: 270, expiration_date: "2011-01-01 00:00:00", created_at: "2008-11-01 00:00:00", updated_at: "2008-11-01 00:00:00", google_order_id: "28326"> hi 1) Spec::Mocks::MockExpectationError in 'WebPage should complete a purchase from google activating the web page' Mock 'WebPage' expected :send_shipping_notice with (any args) once, but received it 0 times ./spec/models/web_page_spec.rb:21:in `given_bought_on' script/spec:4:
This paste will be private.
From the Design Piracy series on my blog: