Probably what you were trying to do here is:

```ruby
fail_with(Failure::Unknown, "#{peer} - Unknown error while authenticating") unless res.code == 302
```