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

ruby-changes:61515

From: Hiroshi <ko1@a...>
Date: Fri, 5 Jun 2020 07:33:44 +0900 (JST)
Subject: [ruby-changes:61515] 459eb684b7 (master): Manually pick from rubygems/rubygems changes at

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

From 459eb684b7a90e11ba5812ce9bb518f4940d3519 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Thu, 4 Jun 2020 21:15:34 +0900
Subject: Manually pick from rubygems/rubygems changes at

https://github.com/rubygems/rubygems/pull/3666/commits/ca5bf584026c9fd3a288eb10c65493e9f01ccc44

diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb
index 8ace671..f222731 100644
--- a/spec/bundler/install/gemfile/groups_spec.rb
+++ b/spec/bundler/install/gemfile/groups_spec.rb
@@ -86,7 +86,8 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L86
       end
 
       it "installs gems in the default group" do
-        bundle! :install, forgotten_command_line_options(:without => "emo")
+        bundle "config --local without emo"
+        bundle! :install
         expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default]
       end
 
@@ -100,24 +101,27 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L101
       end
 
       it "does not install gems from the excluded group" do
-        bundle :install, :without => "emo"
+        bundle "config --local without emo"
+        bundle :install
         expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default]
       end
 
-      it "does not install gems from the previously excluded group" do
-        bundle :install, forgotten_command_line_options(:without => "emo")
+      it "remembers previous exclusion with `--without`", :bundler => "< 3" do
+        bundle "install --without emo"
         expect(the_bundle).not_to include_gems "activesupport 2.3.5"
         bundle :install
         expect(the_bundle).not_to include_gems "activesupport 2.3.5"
       end
 
       it "does not say it installed gems from the excluded group" do
-        bundle! :install, forgotten_command_line_options(:without => "emo")
+        bundle "config --local without emo"
+        bundle! :install
         expect(out).not_to include("activesupport")
       end
 
       it "allows Bundler.setup for specific groups" do
-        bundle :install, forgotten_command_line_options(:without => "emo")
+        bundle "config --local without emo"
+        bundle :install
         run!("require 'rack'; puts RACK", :default)
         expect(out).to eq("1.0.0")
       end
@@ -131,7 +135,8 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L135
           end
         G
 
-        bundle :install, forgotten_command_line_options(:without => "emo")
+        bundle "config --local without emo"
+        bundle :install
         expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => [:default]
       end
 
@@ -147,15 +152,15 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L152
         ENV["BUNDLE_WITHOUT"] = nil
       end
 
-      it "clears --without when passed an empty list" do
-        bundle :install, forgotten_command_line_options(:without => "emo")
+      it "clears --without when passed an empty list", :bundler => "< 3" do
+        bundle "install --without emo"
 
-        bundle :install, forgotten_command_line_options(:without => "")
+        bundle "install --without ''"
         expect(the_bundle).to include_gems "activesupport 2.3.5"
       end
 
-      it "doesn't clear without when nothing is passed" do
-        bundle :install, forgotten_command_line_options(:without => "emo")
+      it "doesn't clear without when nothing is passed", :bundler => "< 3" do
+        bundle "install --without emo"
 
         bundle :install
         expect(the_bundle).not_to include_gems "activesupport 2.3.5"
@@ -167,12 +172,13 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L172
       end
 
       it "installs gems from the optional group when requested" do
-        bundle :install, forgotten_command_line_options(:with => "debugging")
+        bundle "config --local with debugging"
+        bundle :install
         expect(the_bundle).to include_gems "thin 1.0"
       end
 
-      it "installs gems from the previously requested group" do
-        bundle :install, forgotten_command_line_options(:with => "debugging")
+      it "installs gems from the previously requested group", :bundler => "< 3" do
+        bundle "install --with debugging"
         expect(the_bundle).to include_gems "thin 1.0"
         bundle :install
         expect(the_bundle).to include_gems "thin 1.0"
@@ -185,26 +191,26 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L191
         ENV["BUNDLE_WITH"] = nil
       end
 
-      it "clears --with when passed an empty list" do
-        bundle :install, forgotten_command_line_options(:with => "debugging")
-        bundle :install, forgotten_command_line_options(:with => "")
+      it "clears --with when passed an empty list", :bundler => "< 3" do
+        bundle "install --with debugging"
+        bundle "install --with ''"
         expect(the_bundle).not_to include_gems "thin 1.0"
       end
 
       it "removes groups from without when passed at --with", :bundler => "< 3" do
-        bundle :install, forgotten_command_line_options(:without => "emo")
-        bundle :install, forgotten_command_line_options(:with => "emo")
+        bundle "config --local without emo"
+        bundle "install --with emo"
         expect(the_bundle).to include_gems "activesupport 2.3.5"
       end
 
       it "removes groups from with when passed at --without", :bundler => "< 3" do
-        bundle :install, forgotten_command_line_options(:with => "debugging")
-        bundle :install, forgotten_command_line_options(:without => "debugging")
+        bundle "config --local with debugging"
+        bundle "install --without debugging"
         expect(the_bundle).not_to include_gem "thin 1.0"
       end
 
       it "errors out when passing a group to with and without via CLI flags", :bundler => "< 3" do
-        bundle :install, forgotten_command_line_options(:with => "emo debugging", :without => "emo")
+        bundle "install --with emo debugging --without emo"
         expect(last_command).to be_failure
         expect(err).to include("The offending groups are: emo")
       end
@@ -222,19 +228,21 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L228
         expect(the_bundle).to include_gem "thin 1.0"
       end
 
-      it "can add and remove a group at the same time" do
-        bundle :install, forgotten_command_line_options(:with => "debugging", :without => "emo")
+      it "can add and remove a group at the same time", :bundler => "< 3" do
+        bundle "install --with debugging --without emo"
         expect(the_bundle).to include_gems "thin 1.0"
         expect(the_bundle).not_to include_gems "activesupport 2.3.5"
       end
 
       it "has no effect when listing a not optional group in with" do
-        bundle :install, forgotten_command_line_options(:with => "emo")
+        bundle "config --local with emo"
+        bundle :install
         expect(the_bundle).to include_gems "activesupport 2.3.5"
       end
 
       it "has no effect when listing an optional group in without" do
-        bundle :install, forgotten_command_line_options(:without => "debugging")
+        bundle "config --local without debugging"
+        bundle :install
         expect(the_bundle).not_to include_gems "thin 1.0"
       end
     end
@@ -251,12 +259,14 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L259
       end
 
       it "installs gems in the default group" do
-        bundle! :install, forgotten_command_line_options(:without => "emo lolercoaster")
+        bundle "config --local without emo lolercoaster"
+        bundle! :install
         expect(the_bundle).to include_gems "rack 1.0.0"
       end
 
       it "installs the gem if any of its groups are installed" do
-        bundle! :install, forgotten_command_line_options(:without => "emo")
+        bundle "config --local without emo"
+        bundle! :install
         expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
       end
 
@@ -276,23 +286,21 @@ RSpec.describe "bundle install with groups" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/groups_spec.rb#L286
           G
         end
 
-        it "installs the gem w/ option --without emo" do
-          bundle :install, forgotten_command_line_options(:without => "emo")
+        it "installs the gem unless all groups are excluded" do
+          bundle "config --local without emo"
+          bundle :install
           expect(the_bundle).to include_gems "activesupport 2.3.5"
-        end
 
-        it "installs the gem w/ option --without lolercoaster" do
-          bundle :install, forgotten_command_line_options(:without => "lolercoaster")
+          bundle "config --local without lolercoaster"
+          bundle :install
           expect(the_bundle).to include_gems "activesupport 2.3.5"
-        end
 
-        it "does not install the gem w/ option --without emo lolercoaster" do
-          bundle :install, forgotten_command_line_options(:without => "emo lolercoaster")
+          bundle "config --local without emo lolercoaster"
+          bundle :install
           expect(the_bundle).not_to include_gems "activesupport 2.3.5"
-        end
 
-        it "does not install the gem w/ option --without 'emo lolercoaster'" do
-          bundle :install, forgotten_command_line_options(:without => "'emo lolerc (... truncated)

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

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