diff options
author | Grey Baker <greysteil@gmail.com> | 2019-01-14 20:46:12 +0000 |
---|---|---|
committer | Grey Baker <greysteil@gmail.com> | 2019-01-14 20:46:12 +0000 |
commit | 23ddab395df40692585e2fcc635dbf3e5ee1db2a (patch) | |
tree | 4d9f8168e9ddf7c8236516d034843efa03c34081 /spec | |
parent | 95f9094c96d6923f9a7995b97ddb92b9c5c4bb96 (diff) | |
download | bundler-23ddab395df40692585e2fcc635dbf3e5ee1db2a.tar.gz |
Ensure credentials are masked in FallbackError from Net::HTTPNotFoundgreysteil/show-notfound-uri
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/fetcher/downloader_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/bundler/fetcher/downloader_spec.rb b/spec/bundler/fetcher/downloader_spec.rb index ac2c197956..07b507266b 100644 --- a/spec/bundler/fetcher/downloader_spec.rb +++ b/spec/bundler/fetcher/downloader_spec.rb @@ -91,6 +91,15 @@ RSpec.describe Bundler::Fetcher::Downloader do expect { subject.fetch(uri, options, counter) }. to raise_error(Bundler::Fetcher::FallbackError, "Net::HTTPNotFound: http://www.uri-to-fetch.com/api/v2/endpoint") end + + context "when the there are credentials provided in the request" do + let(:uri) { URI("http://username:password@www.uri-to-fetch.com/api/v2/endpoint") } + + it "should raise a Bundler::Fetcher::FallbackError that doesn't contain the password" do + expect { subject.fetch(uri, options, counter) }. + to raise_error(Bundler::Fetcher::FallbackError, "Net::HTTPNotFound: http://username@www.uri-to-fetch.com/api/v2/endpoint") + end + end end context "when the request response is some other type" do |