adamwiggins / rest-client

Simple REST client for Ruby, inspired by microframework syntax for specifying actions.

This URL has Read+Write access

rest-client / spec / response_spec.rb
100644 17 lines (13 sloc) 0.4 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require File.dirname(__FILE__) + '/base'
 
describe RestClient::Response do
before do
@net_http_res = mock('net http response')
@response = RestClient::Response.new('abc', @net_http_res)
end
 
it "behaves like string" do
@response.should == 'abc'
end
 
it "accepts nil strings and sets it to empty for the case of HEAD" do
RestClient::Response.new(nil, @net_http_res).should == ""
end
end