test/test_helper.rb in twilio-2.4.0 vs test/test_helper.rb in twilio-2.4.1

- old
+ new

@@ -12,9 +12,18 @@ def fixture(filename) #:nodoc: path = File.join(File.dirname(__FILE__), "fixtures/xml/#{filename}.xml") File.read path end +def stub_response(verb, fixture_name, options = {}) #:nodoc: + fake_response = fixture(fixture_name) + resource = options.delete(:resource) + options = { :body => fake_response }.merge(options) + FakeWeb.register_uri(verb, twilio_url(resource), options) + + fake_response +end + def twilio_url(url=nil) #:nodoc: "https://mysid:mytoken@api.twilio.com:443/2008-08-01/Accounts/mysid#{'/' + url if url}" end def verb_response(verb) #:nodoc: \ No newline at end of file