Skip to content

Remove deprecated Faraday::Request#method #1303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/faraday/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ def self.create(request_method)
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
Expand Down
11 changes: 0 additions & 11 deletions spec/faraday/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@
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') } }

Expand Down