Sha256: 8c822e9ab448679776ff4eb9caafd2b721c551ed1635bb768692fd8dc0caaca7

Contents?: true

Size: 621 Bytes

Versions: 3

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

describe 'Errors' do
  let(:client) { AngellistApi::Client.new }

  describe AngellistApi::Error::TooManyRequests do
    context 'when response is an over rate limit error',
      :vcr => { :cassette_name => 'errors/too_many_requests' } do

      it 'is raised' do
        expect { client.me }.to raise_error described_class
      end
    end

    context 'when response is some other 403 Forbidden error',
      :vcr => { :cassette_name => 'errors/forbidden' } do

      it 'is not raised' do
        expect { client.me }.to raise_error AngellistApi::Error::Forbidden
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
angellist_api-1.1.0 spec/integration/errors_spec.rb
angellist_api-1.0.7 spec/integration/errors_spec.rb
angellist_api-1.0.6 spec/integration/errors_spec.rb