postrank-labs/goliath — pull request #240 by kybishop (2013-05-02 04:11:22+00:00)
Title: Make test_helper requests that trigger an errback fail by default

The current test_helper requests have some devious default behavior.

Consider the following specs:

```ruby
describe 'sending requests' do
let(:my_request) do
{
:domain => localhost:9001, # A port the server is NOT running on!!
:path => '/some_path'
}
end

context 'when sent to invalid path' do
it 'sends a 500' do
with_api(MyApi) do
get_request(my_request) do |http|
http.response_header.status.should == 500
end
end
end
end

context 'when sent to a valid path' do
it 'sends a 200' do
with_api(MyApi) do
get_request(my_request) do |http|
http.response_header.status.should == 200
end
end
end
end
```

Both of these specs pass! As soon as you add the optional errback param, as a proc that raises, the true failure show through on both specs.