summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_uri.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_uri.rb')
-rw-r--r--test/rubygems/test_gem_uri.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_uri.rb b/test/rubygems/test_gem_uri.rb
index 0c70443f32..1253ebc6de 100644
--- a/test/rubygems/test_gem_uri.rb
+++ b/test/rubygems/test_gem_uri.rb
@@ -1,5 +1,7 @@
-require_relative 'helper'
-require 'rubygems/uri'
+# frozen_string_literal: true
+
+require_relative "helper"
+require "rubygems/uri"
class TestUri < Gem::TestCase
def test_to_s_not_string
@@ -29,4 +31,11 @@ class TestUri < Gem::TestCase
def test_redacted_with_invalid_uri
assert_equal "https://www.example.com:80index", Gem::Uri.new("https://www.example.com:80index").redacted.to_s
end
+
+ def test_redacted_does_not_modify_uri
+ url = "https://user:password@example.com"
+ uri = Gem::Uri.new(url)
+ assert_equal "https://user:REDACTED@example.com", uri.redacted.to_s
+ assert_equal url, uri.to_s
+ end
end