Skip to content

Instantly share code, notes, and snippets.

@yangchenyun
Created July 29, 2012 15:46
Show Gist options
  • Save yangchenyun/3199633 to your computer and use it in GitHub Desktop.
Save yangchenyun/3199633 to your computer and use it in GitHub Desktop.
more detailed spy
it "should call the given method when parameter is valid", ->
multipleSpy = sinon.spy sample, 'multiple'
sample.calculator('multiple', 1, 2)
sinon.assert.calledOnce(multipleSpy)
sinon.assert.calledWithExactly(multipleSpy, [1, 2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment