mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
lib/rubygems: bump up RubyGems version to 2.6.12. [Backport #13842]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1069d3f18b
commit
fd41a38470
17 changed files with 175 additions and 18 deletions
|
@ -108,6 +108,58 @@ source #{@gem_repo} already present in the cache
|
|||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_add_redundant_source_trailing_slash
|
||||
# Remove pre-existing gem source (w/ slash)
|
||||
repo_with_slash = "http://gems.example.com/"
|
||||
@cmd.handle_options %W[--remove #{repo_with_slash}]
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
source = Gem::Source.new repo_with_slash
|
||||
assert_equal false, Gem.sources.include?(source)
|
||||
|
||||
expected = <<-EOF
|
||||
#{repo_with_slash} removed from sources
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
|
||||
# Re-add pre-existing gem source (w/o slash)
|
||||
repo_without_slash = "http://gems.example.com"
|
||||
@cmd.handle_options %W[--add #{repo_without_slash}]
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
source = Gem::Source.new repo_without_slash
|
||||
assert_equal true, Gem.sources.include?(source)
|
||||
|
||||
expected = <<-EOF
|
||||
http://gems.example.com/ removed from sources
|
||||
http://gems.example.com added to sources
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
|
||||
# Re-add original gem source (w/ slash)
|
||||
@cmd.handle_options %W[--add #{repo_with_slash}]
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
source = Gem::Source.new repo_with_slash
|
||||
assert_equal true, Gem.sources.include?(source)
|
||||
|
||||
expected = <<-EOF
|
||||
http://gems.example.com/ removed from sources
|
||||
http://gems.example.com added to sources
|
||||
source http://gems.example.com/ already present in the cache
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_add_http_rubygems_org
|
||||
http_rubygems_org = 'http://rubygems.org'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue