Skip to content

Instantly share code, notes, and snippets.

@davespanton
Created December 16, 2011 21:40
Show Gist options
  • Save davespanton/1488122 to your computer and use it in GitHub Desktop.
Save davespanton/1488122 to your computer and use it in GitHub Desktop.
Return a stub from Titanium.Network.createHTTPClient
var stubClient = function() {};
stubClient.send = function() {};
stubClient.open = function(type, url) {};
spyOn(Titanium.Network, "createHTTPClient").andReturn(stubClient);
spyOn(stubClient, "send");
spyOn(stubClient, "open");
@stereoket
Copy link

Would be very interested to see a post on a complete spec file and setup that uses jasmine/titanium and sinon.js

@davespanton
Copy link
Author

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