Skip to content

Commit

Permalink
[TEST] fix compatibility with ruby 3.4.0dev
Browse files Browse the repository at this point in the history
ruby 3.4 changes Hash#inspect formatting as:
https://bugs.ruby-lang.org/issues/20433

Closes #1602
  • Loading branch information
mtasaka authored and olleolleolle committed Dec 3, 2024
1 parent f9f4ce5 commit b7b2bc1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/faraday/error_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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('#<Faraday::Error response={:status=>400}>') }
if RUBY_VERSION >= '3.4'
it { expect(subject.inspect).to eq('#<Faraday::Error response={status: 400}>') }
else
it { expect(subject.inspect).to eq('#<Faraday::Error response={:status=>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 }
Expand Down Expand Up @@ -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('#<Faraday::Error response={:status=>400}>') }
if RUBY_VERSION >= '3.4'
it { expect(subject.inspect).to eq('#<Faraday::Error response={status: 400}>') }
else
it { expect(subject.inspect).to eq('#<Faraday::Error response={:status=>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 }
Expand Down

0 comments on commit b7b2bc1

Please sign in to comment.