ruby-changes:72606
From: David <ko1@a...>
Date: Wed, 20 Jul 2022 19:55:45 +0900 (JST)
Subject: [ruby-changes:72606] bdef3c73fe (master): [rubygems/rubygems] Unify common logic
https://git.ruby-lang.org/ruby.git/commit/?id=bdef3c73fe From bdef3c73fe3792de59ecf681d2dcfcc8f62422b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Sat, 16 Jul 2022 13:31:24 +0200 Subject: [rubygems/rubygems] Unify common logic https://github.com/rubygems/rubygems/commit/e5434be14c --- test/rubygems/test_gem_commands_setup_command.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb index 69db09f747..b4e31f4eb4 100644 --- a/test/rubygems/test_gem_commands_setup_command.rb +++ b/test/rubygems/test_gem_commands_setup_command.rb @@ -211,11 +211,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L211 assert_path_exist File.join bin_dir, e end - default_dir = Gem.default_specifications_dir - # expect to remove other versions of bundler gemspecs on default specification directory. - assert_path_not_exist File.join(default_dir, "bundler-1.15.4.gemspec") - assert_path_exist File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec") + assert_path_not_exist previous_bundler_specification_path + assert_path_exist new_bundler_specification_path # expect to not remove bundler-* gemspecs. assert_path_exist File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec") @@ -239,11 +237,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L237 @cmd.install_default_bundler_gem bin_dir - default_dir = Gem.default_specifications_dir - # expect to remove other versions of bundler gemspecs on default specification directory. - assert_path_not_exist File.join(default_dir, "bundler-1.15.4.gemspec") - assert_path_exist File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec") + assert_path_not_exist previous_bundler_specification_path + assert_path_exist new_bundler_specification_path end def test_install_default_bundler_gem_with_force_flag @@ -462,4 +458,12 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L458 def default_bundler_bin_path File.join RbConfig::CONFIG['bindir'], 'bundler' end + + def previous_bundler_specification_path + File.join(Gem.default_specifications_dir, "bundler-1.15.4.gemspec") + end + + def new_bundler_specification_path + File.join(Gem.default_specifications_dir, "bundler-#{BUNDLER_VERS}.gemspec") + end end unless Gem.java_platform? -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/