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

19 lines
478 B
Ruby
Raw Normal View History

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