Created
January 29, 2014 14:04
-
-
Save jasonkarns/8688601 to your computer and use it in GitHub Desktop.
Demonstrate Jasmine spies' odd behavior of verifying against argument references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
munge = (operator) -> | |
data = x: 1 | |
data.y = operator(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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