Created
December 16, 2011 21:40
-
-
Save davespanton/1488122 to your computer and use it in GitHub Desktop.
Return a stub from Titanium.Network.createHTTPClient
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
var stubClient = function() {}; | |
stubClient.send = function() {}; | |
stubClient.open = function(type, url) {}; | |
spyOn(Titanium.Network, "createHTTPClient").andReturn(stubClient); | |
spyOn(stubClient, "send"); | |
spyOn(stubClient, "open"); |
Next time I'm on a Titanium project I'll look into that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would be very interested to see a post on a complete spec file and setup that uses jasmine/titanium and sinon.js