Skip to content

Commit

Permalink
Remove deprecated Faraday::Request#method (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleolleolle committed Aug 9, 2021
1 parent 4b6162d commit 4561917
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
8 changes: 0 additions & 8 deletions lib/faraday/request.rb
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
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

0 comments on commit 4561917

Please sign in to comment.