mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
Lint Style/RedundantBegin
This commit is contained in:
parent
59c32867b3
commit
e640be9866
@ -67,9 +67,3 @@ Performance/StringInclude:
|
||||
Exclude:
|
||||
- 'spec/support/fake_safe_buffer.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
Style/RedundantBegin:
|
||||
Exclude:
|
||||
- 'spec/faraday/request/instrumentation_spec.rb'
|
||||
- 'spec/faraday/response/json_spec.rb'
|
||||
|
@ -30,13 +30,11 @@ RSpec.describe Faraday::Request::Instrumentation do
|
||||
|
||||
it { expect(options.name).to eq('request.faraday') }
|
||||
it 'defaults to ActiveSupport::Notifications' do
|
||||
begin
|
||||
res = options.instrumenter
|
||||
rescue NameError => e
|
||||
expect(e.to_s).to match('ActiveSupport')
|
||||
else
|
||||
expect(res).to eq(ActiveSupport::Notifications)
|
||||
end
|
||||
res = options.instrumenter
|
||||
rescue NameError => e
|
||||
expect(e.to_s).to match('ActiveSupport')
|
||||
else
|
||||
expect(res).to eq(ActiveSupport::Notifications)
|
||||
end
|
||||
|
||||
it 'instruments with default name' do
|
||||
|
@ -76,12 +76,10 @@ RSpec.describe Faraday::Response::Json, type: :response do
|
||||
end
|
||||
|
||||
it 'includes the response on the ParsingError instance' do
|
||||
begin
|
||||
process('{') { |env| env[:response] = Faraday::Response.new }
|
||||
raise 'Parsing should have failed.'
|
||||
rescue Faraday::ParsingError => e
|
||||
expect(e.response).to be_a(Faraday::Response)
|
||||
end
|
||||
process('{') { |env| env[:response] = Faraday::Response.new }
|
||||
raise 'Parsing should have failed.'
|
||||
rescue Faraday::ParsingError => e
|
||||
expect(e.response).to be_a(Faraday::Response)
|
||||
end
|
||||
|
||||
context 'HEAD responses' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user