Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Sass LupineDev

View GitHub Profile
View keybase.md

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 Apr 21, 2012
rspec mock/stub example
View gist:2433757
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