Sha256: 88e00226990aceeb6037a3e8329c66c580e4b2d12bc64021b773d61f2bd0a002

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require_relative '../_lib'

describe "backwards compatibility" do
  it 'aliases RestMan::NotFound as ResourceNotFound' do
    expect(RestMan::ResourceNotFound).to eq RestMan::NotFound
  end

  it 'aliases old names for HTTP 413, 414, 416' do
    expect(RestMan::RequestEntityTooLarge).to eq RestMan::PayloadTooLarge
    expect(RestMan::RequestURITooLong).to eq RestMan::URITooLong
    expect(RestMan::RequestedRangeNotSatisfiable).to eq RestMan::RangeNotSatisfiable
  end

  it 'subclasses NotFound from RequestFailed, ExceptionWithResponse' do
    expect(RestMan::NotFound).to be < RestMan::RequestFailed
    expect(RestMan::NotFound).to be < RestMan::ExceptionWithResponse
  end

  it 'subclasses timeout from RestMan::RequestTimeout, RequestFailed, EWR' do
    expect(RestMan::Exceptions::OpenTimeout).to be < RestMan::Exceptions::Timeout
    expect(RestMan::Exceptions::ReadTimeout).to be < RestMan::Exceptions::Timeout

    expect(RestMan::Exceptions::Timeout).to be < RestMan::RequestTimeout
    expect(RestMan::Exceptions::Timeout).to be < RestMan::RequestFailed
    expect(RestMan::Exceptions::Timeout).to be < RestMan::ExceptionWithResponse
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rest-man-1.1.0 spec/unit/exceptions/backwards_campatibility_spec.rb