From 61ade85eae6b62edf7c415d5d961c9b45c40d511 Mon Sep 17 00:00:00 2001 From: John Nunemaker Date: Tue, 1 Dec 2015 15:32:27 -0500 Subject: [PATCH] Assertion is enough to test that error doesn't happen If the code to prevent this is removed then an exception will be raised which will fail the test. --- spec/httparty/net_digest_auth_spec.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/spec/httparty/net_digest_auth_spec.rb b/spec/httparty/net_digest_auth_spec.rb index 8ead743..087cbd2 100644 --- a/spec/httparty/net_digest_auth_spec.rb +++ b/spec/httparty/net_digest_auth_spec.rb @@ -154,17 +154,11 @@ RSpec.describe Net::HTTPHeader::DigestAuthenticator do context "with http basic auth response when net digest auth expected" do it "should not fail" do - # fails already so it is defined here - begin - @digest = setup_digest({ - 'www-authenticate' => 'WWW-Authenticate: Basic realm="testrealm.com""' - }) - - expect(authorization_header).to include("Digest") - rescue => e - fail "Should not fail on different authentification method" - end + @digest = setup_digest({ + 'www-authenticate' => 'WWW-Authenticate: Basic realm="testrealm.com""' + }) + expect(authorization_header).to include("Digest") end end