assaf/zombie — pull request #264 by jasonallen (2012-01-19 07:15:50+00:00)
Title: Enable stubbing of resources with pre-canned responses

I use zombie for testing some node apps. In certain cases I don't want the page to actually fetch the real remote resource (FB initialization scripts, for example) - but I want to load something else. This patch enables it. Here's the usage:

browser = new Browser
request = {url:"http://fa.ke/url.js"}
response = {body:'console.log("stubbed script");'}
browser.resources.stubRequest(request, response);