Skip to content

Instantly share code, notes, and snippets.

View LupineDev's full-sized avatar

Christopher Sass LupineDev

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lupinedev on github.
  • I am lupinedev (https://keybase.io/lupinedev) on keybase.
  • I have a public key ASBAPN53gp177aGwTgozkocXsljZuMiOQyzzpHi-GUTBxQo

To claim this, I am signing this object:

@LupineDev
LupineDev / gist:2433757
Created April 21, 2012 03:51
rspec mock/stub example
describe Order do
describe "#sub_total" do
# writing everything to db
it "should calculate the sum of all of its shop_items" do
order = Order.create(some_options)
3.times do
order.shop_items << ShopItem.create(:price => 2.00)
end
order.subtotal.should be_within(0.01).of(6.0)
end