Sha256: 548fba7dfd7502cc88e051702722c4555c2be252fa412d05fad4236f523263d0
Contents?: true
Size: 1.11 KB
Versions: 142
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true RSpec.describe Faraday::Adapter do let(:adapter) { Faraday::Adapter.new } let(:request) { {} } context '#request_timeout' do it 'gets :read timeout' do expect(timeout(:read)).to eq(nil) request[:timeout] = 5 request[:write_timeout] = 1 expect(timeout(:read)).to eq(5) request[:read_timeout] = 2 expect(timeout(:read)).to eq(2) end it 'gets :open timeout' do expect(timeout(:open)).to eq(nil) request[:timeout] = 5 request[:write_timeout] = 1 expect(timeout(:open)).to eq(5) request[:open_timeout] = 2 expect(timeout(:open)).to eq(2) end it 'gets :write timeout' do expect(timeout(:write)).to eq(nil) request[:timeout] = 5 request[:read_timeout] = 1 expect(timeout(:write)).to eq(5) request[:write_timeout] = 2 expect(timeout(:write)).to eq(2) end it 'attempts unknown timeout type' do expect { timeout(:unknown) }.to raise_error(ArgumentError) end def timeout(type) adapter.send(:request_timeout, type, request) end end end
Version data entries
142 entries across 129 versions & 19 rubygems