From 456191715abf77702798926ec8b021c146dcd09b Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 9 Aug 2021 15:30:37 +0200 Subject: [PATCH] Remove deprecated Faraday::Request#method (#1303) --- lib/faraday/request.rb | 8 -------- spec/faraday/request_spec.rb | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/lib/faraday/request.rb b/lib/faraday/request.rb index e2c45948..d456e2e1 100644 --- a/lib/faraday/request.rb +++ b/lib/faraday/request.rb @@ -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 diff --git a/spec/faraday/request_spec.rb b/spec/faraday/request_spec.rb index 018c770c..a5ab8d0d 100644 --- a/spec/faraday/request_spec.rb +++ b/spec/faraday/request_spec.rb @@ -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') } }