Skip to content

Instantly share code, notes, and snippets.

describe "app.Agent", ->
Given -> @car = new Backbone.Model
Given -> spyOn(@car, "get")
Given -> @car.get.when('phone').thenReturn("123-456-789")
Given -> @car.get.when('name').thenReturn("juice")
Then -> expect(@car.get).toHaveBeenCalledWith('phone')
Then -> expect(@car.get).toHaveBeenCalledWith(jasmine.any(String))
Then -> expect(@car.get).toHaveBeenCalledWith jasmine.argThat (arg) ->
arg.length < 5