diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6575cb6d..267d4712 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -76,11 +76,6 @@ Style/GuardClause: - 'lib/faraday/request/url_encoded.rb' - 'lib/faraday/utils/headers.rb' -# Offense count: 1 -Style/MissingRespondToMissing: - Exclude: - - 'lib/faraday.rb' - # Offense count: 1 Style/MultipleComparison: Exclude: diff --git a/lib/faraday.rb b/lib/faraday.rb index c7d96610..df1b61c6 100644 --- a/lib/faraday.rb +++ b/lib/faraday.rb @@ -102,7 +102,7 @@ module Faraday @default_adapter = adapter end - def respond_to?(symbol, include_private = false) + def respond_to_missing?(symbol, include_private = false) default_connection.respond_to?(symbol, include_private) || super end diff --git a/spec/faraday_spec.rb b/spec/faraday_spec.rb index 20115e33..8b603ebb 100644 --- a/spec/faraday_spec.rb +++ b/spec/faraday_spec.rb @@ -24,6 +24,12 @@ RSpec.describe Faraday do ) end + it 'proxied methods can be accessed' do + allow(mock_connection).to receive(:this_should_be_proxied) + + expect(Faraday.method(:this_should_be_proxied)).to be_a(Method) + end + after do Faraday.default_connection = nil end