1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00
rest-client--rest-client/spec/unit/raw_response_spec.rb

23 lines
660 B
Ruby
Raw Permalink Normal View History

require_relative '_lib'
describe RestClient::RawResponse do
2009-12-29 12:27:39 -05:00
before do
@tf = double("Tempfile", :read => "the answer is 42", :open => true, :rewind => true)
@net_http_res = double('net http response')
@request = double('restclient request', :redirection_history => nil)
@response = RestClient::RawResponse.new(@tf, @net_http_res, @request)
2009-12-29 12:27:39 -05:00
end
2009-12-29 12:27:39 -05:00
it "behaves like string" do
expect(@response.to_s).to eq 'the answer is 42'
2009-12-29 12:27:39 -05:00
end
2009-12-29 12:27:39 -05:00
it "exposes a Tempfile" do
expect(@response.file).to eq @tf
2009-12-29 12:27:39 -05:00
end
it "includes AbstractResponse" do
expect(RestClient::RawResponse.ancestors).to include(RestClient::AbstractResponse)
end
end