Skip to content

Commit

Permalink
Fix regex specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Mar 20, 2024
1 parent baa5e16 commit 8773af1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/httparty/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
end

context 'test raise_on requests' do
let(:request) { HTTParty::Request.new(Net::HTTP::Get, '/', raise_on: [404]) }
let(:raise_on) { [404] }
let(:request) { HTTParty::Request.new(Net::HTTP::Get, '/', raise_on: raise_on) }
let(:body) { 'Not Found' }
let(:response) { Net::HTTPNotFound.new('1.1', 404, body) }

Expand All @@ -71,7 +72,7 @@
end

context "and response's status code is not in range" do
subject { described_class.new(request, @response_object, @parsed_response) }
let(:response) { Net::HTTPNotFound.new('1.1', 200, body) }

it 'does not throw exception' do
expect{ subject }.not_to raise_error
Expand All @@ -89,7 +90,7 @@
end

context "and response's status code is not in range" do
subject { described_class.new(request, @response_object, @parsed_response) }
let(:response) { Net::HTTPNotFound.new('1.1', 200, body) }

it 'does not throw exception' do
expect{ subject }.not_to raise_error
Expand Down

0 comments on commit 8773af1

Please sign in to comment.