Skip to content

Instantly share code, notes, and snippets.


Christopher Sass LupineDev

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lupinedev on github.
  • I am lupinedev ( on keybase.
  • I have a public key ASBAPN53gp177aGwTgozkocXsljZuMiOQyzzpHi-GUTBxQo

To claim this, I am signing this object:

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)
order.subtotal.should be_within(0.01).of(6.0)