[前][次][番号順一覧][スレッド一覧]

ruby-changes:69602

From: David <ko1@a...>
Date: Fri, 5 Nov 2021 23:21:08 +0900 (JST)
Subject: [ruby-changes:69602] ef6752c6c4 (master): [rubygems/rubygems] Remove unnecessary test setup

https://git.ruby-lang.org/ruby.git/commit/?id=ef6752c6c4

From ef6752c6c40579205c5876b5a2de82c35874c5d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Fri, 5 Nov 2021 13:46:32 +0100
Subject: [rubygems/rubygems] Remove unnecessary test setup

The method being unit tested here doesn't use
`RbConfig::CONFIG["bindir"]`.

https://github.com/rubygems/rubygems/commit/d3f092ad14
---
 test/rubygems/test_gem_commands_setup_command.rb | 36 +++++++++++-------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index 9ce162b1232..b712c8a2a7f 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -225,22 +225,20 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L225
       f.puts 'echo "hello"'
     end
 
-    bindir(bin_dir) do
-      @cmd.options[:force] = true
+    @cmd.options[:force] = true
 
-      @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)
+    @cmd.install_default_bundler_gem bin_dir
 
-      spec.executables.each do |e|
-        if Gem.win_platform?
-          assert_path_exist File.join(bin_dir, "#{e}.bat")
-        end
+    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)
 
-        assert_path_exist File.join bin_dir, e
+    spec.executables.each do |e|
+      if Gem.win_platform?
+        assert_path_exist File.join(bin_dir, "#{e}.bat")
       end
+
+      assert_path_exist File.join bin_dir, e
     end
   end
 
@@ -249,18 +247,16 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L247
 
     bin_dir = File.join(@gemhome, 'bin')
 
-    bindir(bin_dir) do
-      destdir = File.join(@tempdir, 'foo')
+    destdir = File.join(@tempdir, 'foo')
 
-      @cmd.options[:destdir] = destdir
+    @cmd.options[:destdir] = destdir
 
-      @cmd.install_default_bundler_gem bin_dir
+    @cmd.install_default_bundler_gem bin_dir
 
-      spec = Gem::Specification.load("bundler/bundler.gemspec")
+    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
-      end
+    spec.executables.each do |e|
+      assert_path_exist File.join destdir, @gemhome.gsub(/^[a-zA-Z]:/, ''), 'gems', spec.full_name, spec.bindir, e
     end
   end
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]