From d0164d7b4da6bb5f811437e980f40a8665af8550 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Wed, 5 Jun 2024 10:24:09 -0400 Subject: [PATCH 1/2] Unlock faraday_middleware version This is a followup to https://github.com/github/elastomer-client/pull/309 We can't upgrade faraday to 1.x without also upgrading faraday_middleware to 1.x, so the previous PR didn't get us all the way there. Not much changes in faraday_middleware 1.x except for faraday 1.x support, so I expect elastomer-client to be fully compatible. (We'll revisit this once more for faraday 2.0, which drops the faraday_middleware gem entirely, but that's a problem for another day.) --- CHANGELOG.md | 3 +++ elastomer-client.gemspec | 2 +- lib/elastomer_client/version.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e37eae0..4812fde7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 6.1.1 (2024-06-05) +- Unlock faraday_middleware version to allow 1.x + ## 6.1.0 (2024-04-09) - Replace `Faraday::Error::*` with `Faraday::*` error classes - Handle all `Faraday::Error` instead of `Faraday::Error::ClientError` diff --git a/elastomer-client.gemspec b/elastomer-client.gemspec index 1efab4dd..3c049fec 100644 --- a/elastomer-client.gemspec +++ b/elastomer-client.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.add_dependency "addressable", "~> 2.5" spec.add_dependency "faraday", ">= 0.17" - spec.add_dependency "faraday_middleware", "~> 0.14" + spec.add_dependency "faraday_middleware", ">= 0.14" spec.add_dependency "multi_json", "~> 1.12" spec.add_dependency "semantic", "~> 1.6" end diff --git a/lib/elastomer_client/version.rb b/lib/elastomer_client/version.rb index 8535cd82..363e080e 100644 --- a/lib/elastomer_client/version.rb +++ b/lib/elastomer_client/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module ElastomerClient - VERSION = "6.1.0" + VERSION = "6.1.1" def self.version VERSION From e7470aa9aeb5d5f07123dbffb259be07065f03e4 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Wed, 5 Jun 2024 11:44:03 -0400 Subject: [PATCH 2/2] Fix tests for Faraday 1.0 The adapter is now stored separately (it's been that way for some time, but we're newly using the new mechanism after upgrading). Before: ``` ``` After: ``` ``` So this commit updates these tests to check that we're using the right adapter instead of checking that the adapter is in the list of handlers. --- test/client_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/client_test.rb b/test/client_test.rb index e1ca5577..30c87fcb 100644 --- a/test/client_test.rb +++ b/test/client_test.rb @@ -9,7 +9,7 @@ it "uses the adapter specified at creation" do c = ElastomerClient::Client.new(adapter: :test) - assert_includes c.connection.builder.handlers, Faraday::Adapter::Test + assert_equal c.connection.builder.adapter, Faraday::Adapter::Test end it "allows configuring the Faraday when a block is given" do @@ -28,7 +28,7 @@ c = ElastomerClient::Client.new adapter = Faraday::Adapter.lookup_middleware(Faraday.default_adapter) - assert_includes c.connection.builder.handlers, adapter + assert_equal c.connection.builder.adapter, adapter end it "uses the same connection for all requests" do