Created
March 27, 2013 18:07
-
-
Save kinsteronline/5256646 to your computer and use it in GitHub Desktop.
Does this work? Will this give me the ruby mocha like expectation? missle.expects(:launch).never
This file contains hidden or 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
function callWatcher(fn) { | |
var called = false; | |
return function() { | |
if(!called) { | |
called = true; | |
} | |
return !called; | |
}; | |
} | |
var successfulCallback = function() { | |
console.log("I am a raving success!!!!"); | |
}; | |
successfulCallback = callWatcher(successfulCallback); | |
// Has this callback been called? | |
expect(successfulCallback()).to.be.false; | |
expect(successfulCallback()).to.be.true; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment