From 83f74795a6af636da394d62472e8e15a01139a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Tue, 15 Sep 2026 17:34:14 -0300 Subject: [PATCH] ci: Pin json below 3 when testing against Faraday 1 Faraday 1's JSON response middleware passes its options to JSON.parse as a positional hash, which json 3.0 removed, so every Faraday 1 cell fails in spec/json_spec.rb since json 3.0.2 became the default resolution. --- Gemfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8615fc3..2c94414 100644 --- a/Gemfile +++ b/Gemfile @@ -6,12 +6,18 @@ install_if -> { ENV['FARADAY_VERSION'] } do gem 'faraday', ENV['FARADAY_VERSION'] end -if /\D*([\d.]*)/.match(ENV.fetch('FARADAY_VERSION', ''))[1].start_with?('0') +faraday_version = /\D*([\d.]*)/.match(ENV.fetch('FARADAY_VERSION', ''))[1] + +if faraday_version.start_with?('0') gem 'faraday_middleware' elsif ENV['FARADAY_ADAPTER'] == 'em_http' gem 'faraday-em_http' end +# Faraday 1's JSON response middleware passes its options to JSON.parse as a +# positional hash, which json 3 no longer accepts. +gem 'json', '< 3' if faraday_version.start_with?('1') + gem 'activesupport', '>= 7.0' gem 'em-http-request', '>= 1.1' gem 'rackup'