Skip to content

Commit b7b2bc1

Browse files
mtasakaolleolleolle
authored andcommitted
[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
1 parent f9f4ce5 commit b7b2bc1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

spec/faraday/error_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
it { expect(subject.wrapped_exception).to be_nil }
2525
it { expect(subject.response).to eq(exception) }
2626
it { expect(subject.message).to eq('the server responded with status 400') }
27-
it { expect(subject.inspect).to eq('#<Faraday::Error response={:status=>400}>') }
27+
if RUBY_VERSION >= '3.4'
28+
it { expect(subject.inspect).to eq('#<Faraday::Error response={status: 400}>') }
29+
else
30+
it { expect(subject.inspect).to eq('#<Faraday::Error response={:status=>400}>') }
31+
end
2832
it { expect(subject.response_status).to eq(400) }
2933
it { expect(subject.response_headers).to be_nil }
3034
it { expect(subject.response_body).to be_nil }
@@ -61,7 +65,11 @@
6165
it { expect(subject.wrapped_exception).to be_nil }
6266
it { expect(subject.response).to eq(response) }
6367
it { expect(subject.message).to eq('custom message') }
64-
it { expect(subject.inspect).to eq('#<Faraday::Error response={:status=>400}>') }
68+
if RUBY_VERSION >= '3.4'
69+
it { expect(subject.inspect).to eq('#<Faraday::Error response={status: 400}>') }
70+
else
71+
it { expect(subject.inspect).to eq('#<Faraday::Error response={:status=>400}>') }
72+
end
6573
it { expect(subject.response_status).to eq(400) }
6674
it { expect(subject.response_headers).to be_nil }
6775
it { expect(subject.response_body).to be_nil }

0 commit comments

Comments
 (0)