Sha256: b818a3d0147526fa59ac1715c371eaf349f1ce8774f8312927e41b507f46ff18

Contents?: true

Size: 489 Bytes

Versions: 7

Compression:

Stored size: 489 Bytes

Contents

require File.join File.dirname(__FILE__), 'env.rb'

describe Geoloqi::ApiError do
  it 'throws exception properly and allows drill-down of message' do
    error = Geoloqi::ApiError.new 405, 'not_enough_cats', 'not enough cats to complete this request'
    expect { error.status == 405 }
    expect { error.type == 'not_enough_cats' }
    expect { error.reason == 'not enough cats to complete this request' }
    expect { error.message == "#{error.type} - #{error.reason} (405)" }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
geoloqi-0.9.35 spec/geoloqi_api_error_spec.rb
geoloqi-0.9.33 spec/geoloqi_api_error_spec.rb
geoloqi-0.9.32 spec/geoloqi_api_error_spec.rb
geoloqi-0.9.31 spec/geoloqi_api_error_spec.rb
geoloqi-0.9.30 spec/geoloqi_api_error_spec.rb
geoloqi-0.9.28 spec/geoloqi_api_error_spec.rb
geoloqi-0.9.27 spec/geoloqi_api_error_spec.rb