aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_remote_fetch_error.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-28 00:33:08 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-28 00:33:08 +0000
commitb16003cb23ea1352856bfee7811ccff4b9f53028 (patch)
tree5795b83f4ca64ebee9a9f1586cfd6489eafce0e4 /test/rubygems/test_remote_fetch_error.rb
parent73e1a6e8ebcef015d91886f31537fd04049d56b3 (diff)
downloadruby-b16003cb23ea1352856bfee7811ccff4b9f53028.tar.gz
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.4.
Please see entries of 2.6.4 on https://github.com/rubygems/rubygems/blob/master/History.txt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_remote_fetch_error.rb')
-rw-r--r--test/rubygems/test_remote_fetch_error.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/rubygems/test_remote_fetch_error.rb b/test/rubygems/test_remote_fetch_error.rb
new file mode 100644
index 0000000000..6b0f5477d6
--- /dev/null
+++ b/test/rubygems/test_remote_fetch_error.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+require 'rubygems/test_case'
+
+class TestRemoteFetchError < Gem::TestCase
+
+ def test_password_redacted
+ error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@gemsource.org')
+ refute_match error.to_s, 'secret'
+ end
+
+ def test_invalid_url
+ error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://::gemsource.org')
+ assert_equal error.to_s, 'There was an error fetching (https://::gemsource.org)'
+ end
+
+ def test_to_s
+ error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://gemsource.org')
+ assert_equal error.to_s, 'There was an error fetching (https://gemsource.org)'
+ end
+end
+