Sha256: 999ccf85d121f9e5bc1878c05f86804ca3f8f014c494acf62347e25516842230

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

require 'helper'

describe Faraday::Response do
  before do
    @client = FuturesPipeline::Client.new
  end

  {
    400 => Faraday::Error::ClientError,
    401 => Faraday::Error::ClientError,
    403 => Faraday::Error::ClientError,
    404 => Faraday::Error::ResourceNotFound,
    406 => Faraday::Error::ClientError,
    500 => Faraday::Error::ClientError,
    501 => Faraday::Error::ClientError,
    502 => Faraday::Error::ClientError,
    503 => Faraday::Error::ClientError,
  }.each do |status, exception|
    context "when HTTP status is #{status}" do

      it "should raise #{exception.name} error" do
        lambda do
          @client.career("11-1011.01")
        end.should raise_error(exception)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
futures_pipeline-0.0.2 spec/faraday/response_spec.rb
futures_pipeline-0.0.1 spec/faraday/response_spec.rb