Sha256: 5cecd18561cd4cd65c925023962aa9484cdfb9acb2b601028d6830d78b79d668

Contents?: true

Size: 672 Bytes

Versions: 32

Compression:

Stored size: 672 Bytes

Contents

require 'rubygems'
gem 'rspec'
require 'spec'
require File.join(File.dirname(__FILE__), '..', 'lib', 'httparty')

def file_fixture(filename)
  open(File.join(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

32 entries across 32 versions & 9 rubygems

Version Path
voxdolo-httparty-0.3.1 spec/spec_helper.rb
voxdolo-httparty-0.4.1 spec/spec_helper.rb
httparty-0.2.10 spec/spec_helper.rb
httparty-0.3.0 spec/spec_helper.rb
httparty-0.3.1 spec/spec_helper.rb
httparty-0.2.8 spec/spec_helper.rb
httparty-0.2.9 spec/spec_helper.rb
httparty-0.2.7 spec/spec_helper.rb
httparty-0.4.0 spec/spec_helper.rb
httparty-0.4.3 spec/spec_helper.rb
httparty-0.4.2 spec/spec_helper.rb
httparty-0.4.1 spec/spec_helper.rb