diff --git a/spec/faraday/error_spec.rb b/spec/faraday/error_spec.rb index 98a31b84e..85d1f8602 100644 --- a/spec/faraday/error_spec.rb +++ b/spec/faraday/error_spec.rb @@ -24,6 +24,15 @@ it { expect(subject.inspect).to eq('#400}>') } end + context 'with response hash but nil status' do + let(:exception) { { status: nil } } + + it { expect(subject.wrapped_exception).to be_nil } + it { expect(subject.response).to eq(exception) } + it { expect(subject.message).to eq('the server responded with a nil status') } + it { expect(subject.inspect).to eq('#nil}>') } + end + context 'with string' do let(:exception) { 'custom message' }