public
anonymous / jspec_with.coffee
Created

jspec with coffeescript

  • Download Gist
jspec_with.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10 11 12 13
JSpec.describe 'ShoppingCart', ->
before_each ->
cart = new ShoppingCart
 
describe 'addProducts', ->
it 'should add several products', ->
cart.addProducts('cookie')
cart.addProducts('icecream')
expect(cart).to(have, 2, 'products')
 
describe 'checkout', ->
it 'should throw an error when checking out with no products', ->
expect(-> cart.clear().checkout()).to(throw_error, EmptyCart)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.