Remove deprecated Faraday::Request#method (#1303)

This commit is contained in:
Olle Jonsson 2021-08-09 15:30:37 +02:00 committed by GitHub
parent 4b6162d364
commit 456191715a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 19 deletions

View File

@ -41,14 +41,6 @@ module Faraday
end
end
def method
warn <<~TEXT
WARNING: `Faraday::Request##{__method__}` is deprecated; use `#http_method` instead. It will be removed in or after version 2.0.
`Faraday::Request##{__method__}` called from #{caller_locations(1..1).first}
TEXT
http_method
end
# Replace params, preserving the existing hash type.
#
# @param hash [Hash] new params

View File

@ -22,17 +22,6 @@ RSpec.describe Faraday::Request do
it { expect(subject.http_method).to eq(:post) }
end
describe 'deprecate method for HTTP method' do
let(:http_method) { :post }
let(:expected_warning) do
%r{WARNING: `Faraday::Request#method` is deprecated; use `#http_method` instead. It will be removed in or after version 2.0.\n`Faraday::Request#method` called from .+/spec/faraday/request_spec.rb:\d+.}
end
it { expect(subject.method).to eq(:post) }
it { expect { subject.method }.to output(expected_warning).to_stderr }
end
context 'when setting the url on setup with a URI' do
let(:block) { proc { |req| req.url URI.parse('foo.json?a=1') } }