File: raw_response_spec.rb

package info (click to toggle)
librestclient-ruby 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 276 kB
  • ctags: 133
  • sloc: ruby: 1,994; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 439 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require File.dirname(__FILE__) + '/base'

describe RestClient::RawResponse do
  before do
    @tf = mock("Tempfile", :read => "the answer is 42", :open => true)
    @net_http_res = mock('net http response')
    @response = RestClient::RawResponse.new(@tf, @net_http_res, {})
  end

  it "behaves like string" do
    @response.to_s.should == 'the answer is 42'
  end

  it "exposes a Tempfile" do
    @response.file.should == @tf
  end
end