From b7b2bc19e97aa9dd523a50b433b7d7721fa8f68b Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Tue, 3 Dec 2024 15:48:12 +0900 Subject: [PATCH] [TEST] fix compatibility with ruby 3.4.0dev ruby 3.4 changes Hash#inspect formatting as: https://bugs.ruby-lang.org/issues/20433 Closes #1602 --- spec/faraday/error_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/faraday/error_spec.rb b/spec/faraday/error_spec.rb index fd30e2d34..170f32672 100644 --- a/spec/faraday/error_spec.rb +++ b/spec/faraday/error_spec.rb @@ -24,7 +24,11 @@ it { expect(subject.wrapped_exception).to be_nil } it { expect(subject.response).to eq(exception) } it { expect(subject.message).to eq('the server responded with status 400') } - it { expect(subject.inspect).to eq('#400}>') } + if RUBY_VERSION >= '3.4' + it { expect(subject.inspect).to eq('#') } + else + it { expect(subject.inspect).to eq('#400}>') } + end it { expect(subject.response_status).to eq(400) } it { expect(subject.response_headers).to be_nil } it { expect(subject.response_body).to be_nil } @@ -61,7 +65,11 @@ it { expect(subject.wrapped_exception).to be_nil } it { expect(subject.response).to eq(response) } it { expect(subject.message).to eq('custom message') } - it { expect(subject.inspect).to eq('#400}>') } + if RUBY_VERSION >= '3.4' + it { expect(subject.inspect).to eq('#') } + else + it { expect(subject.inspect).to eq('#400}>') } + end it { expect(subject.response_status).to eq(400) } it { expect(subject.response_headers).to be_nil } it { expect(subject.response_body).to be_nil }