Store want/have in URL/local storage
This commit is contained in:
@@ -28,15 +28,15 @@ describe 'inventory_parser.coffee', ->
|
||||
result.toList().should.eql ['wool']
|
||||
|
||||
it 'can parse a single item with quantity', ->
|
||||
result = parser.parse '4 wool'
|
||||
result = parser.parse '4.wool'
|
||||
result.toList().should.eql [[4, 'wool']]
|
||||
|
||||
it 'can parse multiple mixed-type items', ->
|
||||
result = parser.parse '4 Wool\n10 String\nBoat\n\n'
|
||||
result = parser.parse '4.Wool:10.String:Boat'
|
||||
result.toList().should.eql ['boat', [10, 'string'], [4, 'wool']]
|
||||
|
||||
it 're-uses the given inventory object', ->
|
||||
inventory = new Inventory
|
||||
inventory.add 'string', 8
|
||||
result = parser.parse '4 Wool', inventory
|
||||
result = parser.parse '4.Wool', inventory
|
||||
result.toList().should.eql [[8, 'string'], [4, 'wool']]
|
||||
|
||||
Reference in New Issue
Block a user