1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Manually pick from rubygems/rubygems changes at

ca5bf58402
This commit is contained in:
Hiroshi SHIBATA 2020-06-04 21:15:34 +09:00
parent 4d233d18a2
commit 459eb684b7
Notes: git 2020-06-05 07:33:50 +09:00

View file

@ -86,7 +86,8 @@ RSpec.describe "bundle install with groups" do
end end
it "installs gems in the default group" do 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] expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default]
end end
@ -100,24 +101,27 @@ RSpec.describe "bundle install with groups" do
end end
it "does not install gems from the excluded group" do 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] expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default]
end end
it "does not install gems from the previously excluded group" do it "remembers previous exclusion with `--without`", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:without => "emo") bundle "install --without emo"
expect(the_bundle).not_to include_gems "activesupport 2.3.5" expect(the_bundle).not_to include_gems "activesupport 2.3.5"
bundle :install bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5" expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end end
it "does not say it installed gems from the excluded group" do 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") expect(out).not_to include("activesupport")
end end
it "allows Bundler.setup for specific groups" do 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) run!("require 'rack'; puts RACK", :default)
expect(out).to eq("1.0.0") expect(out).to eq("1.0.0")
end end
@ -131,7 +135,8 @@ RSpec.describe "bundle install with groups" do
end end
G 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] expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => [:default]
end end
@ -147,15 +152,15 @@ RSpec.describe "bundle install with groups" do
ENV["BUNDLE_WITHOUT"] = nil ENV["BUNDLE_WITHOUT"] = nil
end end
it "clears --without when passed an empty list" do it "clears --without when passed an empty list", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:without => "emo") bundle "install --without emo"
bundle :install, forgotten_command_line_options(:without => "") bundle "install --without ''"
expect(the_bundle).to include_gems "activesupport 2.3.5" expect(the_bundle).to include_gems "activesupport 2.3.5"
end end
it "doesn't clear without when nothing is passed" do it "doesn't clear without when nothing is passed", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:without => "emo") bundle "install --without emo"
bundle :install bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5" expect(the_bundle).not_to include_gems "activesupport 2.3.5"
@ -167,12 +172,13 @@ RSpec.describe "bundle install with groups" do
end end
it "installs gems from the optional group when requested" do 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" expect(the_bundle).to include_gems "thin 1.0"
end end
it "installs gems from the previously requested group" do it "installs gems from the previously requested group", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:with => "debugging") bundle "install --with debugging"
expect(the_bundle).to include_gems "thin 1.0" expect(the_bundle).to include_gems "thin 1.0"
bundle :install bundle :install
expect(the_bundle).to include_gems "thin 1.0" expect(the_bundle).to include_gems "thin 1.0"
@ -185,26 +191,26 @@ RSpec.describe "bundle install with groups" do
ENV["BUNDLE_WITH"] = nil ENV["BUNDLE_WITH"] = nil
end end
it "clears --with when passed an empty list" do it "clears --with when passed an empty list", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:with => "debugging") bundle "install --with debugging"
bundle :install, forgotten_command_line_options(:with => "") bundle "install --with ''"
expect(the_bundle).not_to include_gems "thin 1.0" expect(the_bundle).not_to include_gems "thin 1.0"
end end
it "removes groups from without when passed at --with", :bundler => "< 3" do it "removes groups from without when passed at --with", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:without => "emo") bundle "config --local without emo"
bundle :install, forgotten_command_line_options(:with => "emo") bundle "install --with emo"
expect(the_bundle).to include_gems "activesupport 2.3.5" expect(the_bundle).to include_gems "activesupport 2.3.5"
end end
it "removes groups from with when passed at --without", :bundler => "< 3" do it "removes groups from with when passed at --without", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:with => "debugging") bundle "config --local with debugging"
bundle :install, forgotten_command_line_options(:without => "debugging") bundle "install --without debugging"
expect(the_bundle).not_to include_gem "thin 1.0" expect(the_bundle).not_to include_gem "thin 1.0"
end end
it "errors out when passing a group to with and without via CLI flags", :bundler => "< 3" do 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(last_command).to be_failure
expect(err).to include("The offending groups are: emo") expect(err).to include("The offending groups are: emo")
end end
@ -222,19 +228,21 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).to include_gem "thin 1.0" expect(the_bundle).to include_gem "thin 1.0"
end end
it "can add and remove a group at the same time" do it "can add and remove a group at the same time", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:with => "debugging", :without => "emo") bundle "install --with debugging --without emo"
expect(the_bundle).to include_gems "thin 1.0" expect(the_bundle).to include_gems "thin 1.0"
expect(the_bundle).not_to include_gems "activesupport 2.3.5" expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end end
it "has no effect when listing a not optional group in with" do 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" expect(the_bundle).to include_gems "activesupport 2.3.5"
end end
it "has no effect when listing an optional group in without" do 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" expect(the_bundle).not_to include_gems "thin 1.0"
end end
end end
@ -251,12 +259,14 @@ RSpec.describe "bundle install with groups" do
end end
it "installs gems in the default group" do 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" expect(the_bundle).to include_gems "rack 1.0.0"
end end
it "installs the gem if any of its groups are installed" do 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" expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
end end
@ -276,23 +286,21 @@ RSpec.describe "bundle install with groups" do
G G
end end
it "installs the gem w/ option --without emo" do it "installs the gem unless all groups are excluded" do
bundle :install, forgotten_command_line_options(:without => "emo") bundle "config --local without emo"
bundle :install
expect(the_bundle).to include_gems "activesupport 2.3.5" expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "installs the gem w/ option --without lolercoaster" do bundle "config --local without lolercoaster"
bundle :install, forgotten_command_line_options(:without => "lolercoaster") bundle :install
expect(the_bundle).to include_gems "activesupport 2.3.5" expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "does not install the gem w/ option --without emo lolercoaster" do bundle "config --local without emo lolercoaster"
bundle :install, forgotten_command_line_options(:without => "emo lolercoaster") bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5" 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 "config --local without 'emo lolercoaster'"
bundle :install, forgotten_command_line_options(:without => "'emo lolercoaster'") bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5" expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end end
end end
@ -312,12 +320,14 @@ RSpec.describe "bundle install with groups" do
end end
it "installs gems in the default group" do 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" expect(the_bundle).to include_gems "rack 1.0.0"
end end
it "installs the gem if any of its groups are installed" do 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" expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
end end
end end
@ -354,7 +364,8 @@ RSpec.describe "bundle install with groups" do
system_gems "rack-0.9.1" system_gems "rack-0.9.1"
install_gemfile <<-G, forgotten_command_line_options(:without => "rack") bundle "config --local without rack"
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack" gem "rack"
@ -377,7 +388,8 @@ RSpec.describe "bundle install with groups" do
it "does not hit the remote a second time" do it "does not hit the remote a second time" do
FileUtils.rm_rf gem_repo2 FileUtils.rm_rf gem_repo2
bundle! :install, forgotten_command_line_options(:without => "rack").merge(:verbose => true) bundle "config --local without rack"
bundle! :install, :verbose => true
expect(last_command.stdboth).not_to match(/fetching/i) expect(last_command.stdboth).not_to match(/fetching/i)
end end
end end