Skip to content

Instantly share code, notes, and snippets.

@tj
Created April 6, 2009 23:17
Show Gist options
  • Save tj/91003 to your computer and use it in GitHub Desktop.
Save tj/91003 to your computer and use it in GitHub Desktop.
describe 'ShoppingCart'
before_each
.cart = new ShoppingCart
end
describe 'addProducts'
it 'should add several products'
.cart.addProduct('cookie')
.cart.addProduct('icecream')
.cart.should.have 2, 'products'
end
end
describe 'checkout'
it 'throw an error when checking out with no products'
.cart.clear()
-{ .cart.checkout() }.should.throw_error
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment