spec/faraday/request/authorization_spec.rb in faraday-2.0.0.alpha.pre.3 vs spec/faraday/request/authorization_spec.rb in faraday-2.0.0.alpha.pre.4

- old
+ new

@@ -61,9 +61,18 @@ it { expect(response.body).to eq('Bearer custom_from_proc') } include_examples 'does not interfere with existing authentication' end + context 'when passed a callable' do + let(:callable) { double('Callable Authorizer', call: 'custom_from_callable') } + let(:auth_config) { [callable] } + + it { expect(response.body).to eq('Bearer custom_from_callable') } + + include_examples 'does not interfere with existing authentication' + end + context 'when passed too many arguments' do let(:auth_config) { %w[baz foo] } it { expect { response }.to raise_error(ArgumentError) }