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
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
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
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
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
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
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
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
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
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 lolercoaster'")
bundle "config --local without 'emo lolercoaster'"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
end
@ -312,12 +320,14 @@ RSpec.describe "bundle install with groups" do
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
end
@ -354,7 +364,8 @@ RSpec.describe "bundle install with groups" do
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)}"
gem "rack"
@ -377,7 +388,8 @@ RSpec.describe "bundle install with groups" do
it "does not hit the remote a second time" do
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)
end
end