Sha256: ac77d305b81f1bc1b4ad7744b51997a14499efb2240748a526d1e74802bd66ef
Contents?: true
Size: 663 Bytes
Versions: 12
Compression:
Stored size: 663 Bytes
Contents
require 'rubygems' gem 'rspec' require 'spec' require File.expand_path(File.dirname(__FILE__) + '/../lib/httparty') def file_fixture(filename) open(File.dirname(__FILE__) + "/fixtures/#{filename.to_s}").read end def stub_http_response_with(filename) format = filename.split('.').last.intern data = file_fixture(filename) response = Net::HTTPOK.new("1.1", 200, "Content for you") response.stub!(:body).and_return(data) http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost', :format => format) http_request.stub!(:perform_actual_request).and_return(response) HTTParty::Request.should_receive(:new).and_return(http_request) end
Version data entries
12 entries across 12 versions & 1 rubygems