summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-07-11 12:14:05 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-07-19 13:10:40 -0500
commit88ed4a282d95512803a4c08394ca56ed8701384c (patch)
tree36c9a231f145c04d204ae058e7f9121fc60417bd /spec
parent50be11896619d11aa2b86ac332e4cab13ebb26c6 (diff)
downloadbundler-88ed4a282d95512803a4c08394ca56ed8701384c.tar.gz
Ensure groups are properly handled when the overlap in settings
Diffstat (limited to 'spec')
-rw-r--r--spec/install/gemfile/groups_spec.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb
index 12d2dcea0b..dc55f1d8d3 100644
--- a/spec/install/gemfile/groups_spec.rb
+++ b/spec/install/gemfile/groups_spec.rb
@@ -198,17 +198,31 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
- it "does remove groups from with when passed at without" do
+ it "does remove groups from with when passed at --without", :bundler => "< 2" do
bundle :install, forgotten_command_line_options(:with => "debugging")
bundle :install, forgotten_command_line_options(:without => "debugging")
- expect(the_bundle).not_to include_gems "thin 1.0"
+ expect(the_bundle).not_to include_gem "thin 1.0"
end
- it "errors out when passing a group to with and without" do
+ it "errors out when passing a group to with and without via CLI flags", :bundler => "< 2" do
bundle :install, forgotten_command_line_options(:with => "emo debugging", :without => "emo")
+ expect(last_command).to be_failure
expect(out).to include("The offending groups are: emo")
end
+ it "allows the BUNDLE_WITH setting to override BUNDLE_WITHOUT" do
+ bundle! "config --local with debugging"
+
+ bundle! :install
+ expect(the_bundle).to include_gem "thin 1.0"
+
+ bundle! "config --local without debugging"
+ expect(the_bundle).to include_gem "thin 1.0"
+
+ bundle! :install
+ 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")
expect(the_bundle).to include_gems "thin 1.0"