Skip to content

Instantly share code, notes, and snippets.

@jasonkarns
Created January 29, 2014 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonkarns/8688601 to your computer and use it in GitHub Desktop.
Save jasonkarns/8688601 to your computer and use it in GitHub Desktop.
Demonstrate Jasmine spies' odd behavior of verifying against argument references
munge = (operator) ->
data = x: 1
data.y = operator(data)
describe "jasmine spies", ->
Given -> @op = jasmine.createSpy('operator').andReturn(2)
When -> munge @op
Then -> expect(@op).toHaveBeenCalledWith(x:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment