From 8773af1e5fb05f66b32dc51fe8b8d0102f2ee009 Mon Sep 17 00:00:00 2001 From: John Nunemaker Date: Wed, 20 Mar 2024 08:35:53 -0400 Subject: [PATCH] Fix regex specs --- spec/httparty/response_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/httparty/response_spec.rb b/spec/httparty/response_spec.rb index 58945200..fc653981 100644 --- a/spec/httparty/response_spec.rb +++ b/spec/httparty/response_spec.rb @@ -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) } @@ -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 @@ -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