Add new CraftingPlan class

This commit is contained in:
Andrew Miner
2015-09-22 19:54:31 -07:00
parent 6ea97ac3aa
commit de04c79d17
9 changed files with 187 additions and 109 deletions
+6 -3
View File
@@ -189,9 +189,12 @@ describe 'inventory.coffee', ->
describe 'remove', ->
it 'throws when the item is absent', ->
expect(-> inventory.remove('chicken')).to.throw Error,
'cannot remove chicken since it is not in this inventory'
it 'does nothing when the item is absent', ->
before = inventory.unparse()
inventory.remove 'foo'
after = inventory.unparse()
before.should.equal after
it 'throws when the item has insufficient quantity', ->
expect(-> inventory.remove('wool', 10)).to.throw Error,