summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_setup_command.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-07-16 13:38:14 +0200
committergit <svn-admin@ruby-lang.org>2022-07-20 19:55:33 +0900
commitfcfb3ce371f9050ba857d9cfb8af6c14a8570f70 (patch)
treef8038cbd9ffbd4cd829e0c105de3b40a99393b23 /test/rubygems/test_gem_commands_setup_command.rb
parentbdef3c73fe3792de59ecf681d2dcfcc8f62422b1 (diff)
[rubygems/rubygems] More cleanup
https://github.com/rubygems/rubygems/commit/6012800a20
Diffstat (limited to 'test/rubygems/test_gem_commands_setup_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index b4e31f4eb4..c633f69f1b 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -54,7 +54,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
spec_fetcher do |fetcher|
fetcher.download "bundler", "1.15.4"
- fetcher.gem "bundler", BUNDLER_VERS
+ fetcher.gem "bundler", bundler_version
fetcher.gem "bundler-audit", "1.0.0"
end
@@ -164,10 +164,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.options[:destdir] = destdir
@cmd.execute
- spec = Gem::Specification.load("bundler/bundler.gemspec")
-
- spec.executables.each do |e|
- assert_path_exist File.join destdir, @gemhome.gsub(/^[a-zA-Z]:/, ''), 'gems', spec.full_name, spec.bindir, e
+ bundler_spec.executables.each do |e|
+ assert_path_exist File.join destdir, @gemhome.gsub(/^[a-zA-Z]:/, ''), 'gems', bundler_spec.full_name, bundler_spec.bindir, e
end
end
@@ -199,7 +197,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
bin_dir = File.join(@gemhome, 'bin')
@cmd.install_default_bundler_gem bin_dir
- bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
default_spec_path = File.join(Gem.default_specifications_dir, "#{bundler_spec.full_name}.gemspec")
spec = Gem::Specification.load(default_spec_path)
@@ -219,9 +216,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
assert_path_exist File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
# expect to remove normal gem that was same version. because it's promoted default gems.
- assert_path_not_exist File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
+ assert_path_not_exist File.join(Gem.dir, "specifications", "bundler-#{bundler_version}.gemspec")
- assert_path_exist "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
+ assert_path_exist "#{Gem.dir}/gems/bundler-#{bundler_version}"
assert_path_exist "#{Gem.dir}/gems/bundler-1.15.4"
assert_path_exist "#{Gem.dir}/gems/bundler-audit-1.0.0"
end
@@ -258,7 +255,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.install_default_bundler_gem bin_dir
- bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
default_spec_path = File.join(Gem.default_specifications_dir, "#{bundler_spec.full_name}.gemspec")
spec = Gem::Specification.load(default_spec_path)
@@ -283,10 +279,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.install_default_bundler_gem bin_dir
- spec = Gem::Specification.load("bundler/bundler.gemspec")
-
- spec.executables.each do |e|
- assert_path_exist File.join destdir, @gemhome.gsub(/^[a-zA-Z]:/, ''), 'gems', spec.full_name, spec.bindir, e
+ bundler_spec.executables.each do |e|
+ assert_path_exist File.join destdir, @gemhome.gsub(/^[a-zA-Z]:/, ''), 'gems', bundler_spec.full_name, bundler_spec.bindir, e
end
ensure
FileUtils.chmod "+w", @gemhome
@@ -303,10 +297,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.install_default_bundler_gem bin_dir
- spec = Gem::Specification.load("bundler/bundler.gemspec")
-
- spec.executables.each do |e|
- assert_path_exist File.join destdir, 'gems', spec.full_name, spec.bindir, e
+ bundler_spec.executables.each do |e|
+ assert_path_exist File.join destdir, 'gems', bundler_spec.full_name, bundler_spec.bindir, e
end
end
@@ -464,6 +456,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase
end
def new_bundler_specification_path
- File.join(Gem.default_specifications_dir, "bundler-#{BUNDLER_VERS}.gemspec")
+ File.join(Gem.default_specifications_dir, "bundler-#{bundler_version}.gemspec")
+ end
+
+ def bundler_spec
+ Gem::Specification.load("bundler/bundler.gemspec")
+ end
+
+ def bundler_version
+ bundler_spec.version
end
end unless Gem.java_platform?