Skip to content

Commit 8773af1

Browse files
committed
Fix regex specs
1 parent baa5e16 commit 8773af1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/httparty/response_spec.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
end
5252

5353
context 'test raise_on requests' do
54-
let(:request) { HTTParty::Request.new(Net::HTTP::Get, '/', raise_on: [404]) }
54+
let(:raise_on) { [404] }
55+
let(:request) { HTTParty::Request.new(Net::HTTP::Get, '/', raise_on: raise_on) }
5556
let(:body) { 'Not Found' }
5657
let(:response) { Net::HTTPNotFound.new('1.1', 404, body) }
5758

@@ -71,7 +72,7 @@
7172
end
7273

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

7677
it 'does not throw exception' do
7778
expect{ subject }.not_to raise_error
@@ -89,7 +90,7 @@
8990
end
9091

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

9495
it 'does not throw exception' do
9596
expect{ subject }.not_to raise_error

0 commit comments

Comments
 (0)