Skip to content

Commit

Permalink
Fixed hound complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrayner committed Jan 26, 2017
1 parent 7edf1b6 commit 0d67fd9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/parliament/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,18 @@
context 'it returns any other status code than a 200' do
it 'and raises client error when status is within the 400 range' do
stub_request(:get, 'http://localhost:3030/dogs/cats.nt').to_return(status: 400)
expect { Parliament::Request.new(base_url: 'http://localhost:3030').dogs.cats.get }.to raise_error(StandardError, 'This is a HTTPClientError')

expect do
Parliament::Request.new(base_url: 'http://localhost:3030').dogs.cats.get
end.to raise_error(StandardError, 'This is a HTTPClientError')
end

it 'and raises server error when status is within the 500 range' do
stub_request(:get, 'http://localhost:3030/parties/current.nt').to_return(status: 500)
expect { Parliament::Request.new(base_url: 'http://localhost:3030').parties.current.get }.to raise_error(StandardError, 'This is a HTTPServerError')

expect do
Parliament::Request.new(base_url: 'http://localhost:3030').parties.current.get
end.to raise_error(StandardError, 'This is a HTTPServerError')
end
end
end
Expand Down

0 comments on commit 0d67fd9

Please sign in to comment.