Skip to content

Instantly share code, notes, and snippets.

@esmevane
Created July 16, 2013 20:35
Show Gist options
  • Save esmevane/6012419 to your computer and use it in GitHub Desktop.
Save esmevane/6012419 to your computer and use it in GitHub Desktop.
[ CoffeeScript / Jasmine ] Put this in your jasmine tests to abstract simple .toHaveBeenCalled() patterns
expectCall = (object, methodName, action) ->
spyOn object, methodName
action()
expect(object[methodName]).toHaveBeenCalled()
expectCall HE.Modal, 'modalDisplay', -> HE.Modal.InitDomPresence()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment