summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_source_fetch_problem.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_source_fetch_problem.rb')
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_source_fetch_problem.rb b/test/rubygems/test_gem_source_fetch_problem.rb
index 0b1472c0c6..6d8ef360ae 100644
--- a/test/rubygems/test_gem_source_fetch_problem.rb
+++ b/test/rubygems/test_gem_source_fetch_problem.rb
@@ -1,10 +1,11 @@
# frozen_string_literal: true
-require_relative 'helper'
+
+require_relative "helper"
class TestGemSourceFetchProblem < Gem::TestCase
def test_exception
source = Gem::Source.new @gem_repo
- error = RuntimeError.new 'test'
+ error = RuntimeError.new "test"
sf = Gem::SourceFetchProblem.new source, error
@@ -12,15 +13,25 @@ class TestGemSourceFetchProblem < Gem::TestCase
raise sf
end
- assert_equal 'test', e.message
+ assert_equal "test", e.message
end
def test_password_redacted
- source = Gem::Source.new 'https://username:secret@gemsource.com'
- error = RuntimeError.new 'test'
+ source = Gem::Source.new "https://username:secret@gemsource.com"
+ error = RuntimeError.new "test"
+
+ sf = Gem::SourceFetchProblem.new source, error
+
+ refute_match sf.wordy, "secret"
+ end
+
+ def test_source_password_no_redacted
+ source = Gem::Source.new "https://username:secret@gemsource.com"
+ error = RuntimeError.new "test"
sf = Gem::SourceFetchProblem.new source, error
+ sf.wordy
- refute_match sf.wordy, 'secret'
+ assert_match "secret", source.uri.to_s
end
end