Sha256: b2ef715b25bd6491565c15f416e6e4c07b984630e319997259d1fa2c0699d2d2

Contents?: true

Size: 568 Bytes

Versions: 4

Compression:

Stored size: 568 Bytes

Contents

require 'spec_helper'

describe CFoundry::BaseClient do
  let(:base) { CFoundry::BaseClient.new("https://api.cloudfoundry.com") }

  describe '#request_uri' do
    subject { base.request_uri URI.parse(base.target + "/foo"), Net::HTTP::Get }

    context 'when a timeout exception occurs' do
      before { stub_request(:get, 'https://api.cloudfoundry.com/foo').to_raise(::Timeout::Error) }

      it 'raises the correct error' do
        expect { subject }.to raise_error CFoundry::Timeout, "GET https://api.cloudfoundry.com/foo timed out"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cfoundry-0.4.18 spec/cfoundry/baseclient_spec.rb
cfoundry-0.4.17 spec/cfoundry/baseclient_spec.rb
cfoundry-0.4.16 spec/cfoundry/baseclient_spec.rb
cfoundry-0.4.15 spec/cfoundry/baseclient_spec.rb