Sha256: 022292f493a69d31581b71e1fde240243fac7471b10b6cd1be39c751b080e758

Contents?: true

Size: 866 Bytes

Versions: 20

Compression:

Stored size: 866 Bytes

Contents

require File.expand_path(File.dirname(__FILE__)+'/../spec_helper')
describe Restfully::HTTP::Error do
  it "should have a response reader" do
    response = mock("restfully response", :status => 404, :body => {'title' => 'Not Found', 'message' => 'The requested resource cannot be found.', 'code' => 404})
    error = Restfully::HTTP::Error.new(response)
    error.response.should == response
  end
  it "should work properly" do
    response = mock("restfully response", :status => 404, :body => {'title' => 'Not Found', 'message' => 'The requested resource cannot be found.', 'code' => 404})
    begin
      raise Restfully::HTTP::Error.new(response)
    rescue Restfully::HTTP::Error => e
      e.response.should == response
      e.message.should == "404 Not Found. The requested resource cannot be found."
      e.backtrace.should_not be_empty
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
restfully-0.6.3 spec/http/error_spec.rb
restfully-0.6.2 spec/http/error_spec.rb
restfully-0.6.1 spec/http/error_spec.rb
restfully-0.6.0 spec/http/error_spec.rb
restfully-0.5.10 spec/http/error_spec.rb
restfully-0.5.9 spec/http/error_spec.rb
restfully-0.5.8 spec/http/error_spec.rb
restfully-0.5.7 spec/http/error_spec.rb
restfully-0.5.6 spec/http/error_spec.rb
restfully-0.5.5 spec/http/error_spec.rb
restfully-0.5.4 spec/http/error_spec.rb
restfully-0.5.3 spec/http/error_spec.rb
restfully-0.5.2 spec/http/error_spec.rb
restfully-0.5.1 spec/http/error_spec.rb
restfully-0.5.0 spec/http/error_spec.rb
restfully-0.4.1 spec/http/error_spec.rb
restfully-0.4.0 spec/http/error_spec.rb
restfully-0.3.2 spec/http/error_spec.rb
restfully-0.3.1 spec/http/error_spec.rb
restfully-0.3.0 spec/http/error_spec.rb