diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-11-11 10:44:07 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-11-22 10:51:35 +0900 |
commit | e262272b6a50c1a92cdcfee684e82f9242ef8171 (patch) | |
tree | d7baf0c94ed9670d7ef097ce0390ca543ee97b33 /test | |
parent | 24f911f474e11560af5fbd0f637f4c0ded23f604 (diff) |
Merge RubyGems 3.2.29 and Bundler 2.2.29
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/helper.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_source_fetch_problem.rb | 10 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 14 |
3 files changed, 26 insertions, 0 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index fd2763db41..ce05c9cf30 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -398,6 +398,7 @@ class Gem::TestCase < Test::Unit::TestCase ENV['GEM_PRIVATE_KEY_PASSPHRASE'] = PRIVATE_KEY_PASSPHRASE + Gem.instance_variable_set(:@default_specifications_dir, nil) if Gem.java_platform? @orig_default_gem_home = RbConfig::CONFIG['default_gem_home'] RbConfig::CONFIG['default_gem_home'] = @gemhome @@ -481,6 +482,7 @@ class Gem::TestCase < Test::Unit::TestCase RbConfig::CONFIG['bindir'] = @orig_bindir + Gem.instance_variable_set :@default_specifications_dir, nil if Gem.java_platform? RbConfig::CONFIG['default_gem_home'] = @orig_default_gem_home else diff --git a/test/rubygems/test_gem_source_fetch_problem.rb b/test/rubygems/test_gem_source_fetch_problem.rb index 0b1472c0c6..816407781d 100644 --- a/test/rubygems/test_gem_source_fetch_problem.rb +++ b/test/rubygems/test_gem_source_fetch_problem.rb @@ -23,4 +23,14 @@ class TestGemSourceFetchProblem < Gem::TestCase 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 + + assert_match 'secret', source.uri.to_s + end end diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 782ae0380f..336fcf000e 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -2795,6 +2795,20 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use: assert_nothing_raised do @a1.validate end + + # Adding #{f} at the start of the second or later line should be fine. + @a1.description = "(some description)\n#{f}" + + assert_nothing_raised do + @a1.validate + end + + # Adding #{t} at the start of the second or later line should be fine. + @a1.description = "(some description)\n#{t}" + + assert_nothing_raised do + @a1.validate + end end end |