diff options
author | Bundlerbot <bot@bundler.io> | 2019-11-04 14:42:10 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-11-04 14:42:10 +0000 |
commit | 3aa03910cdc95ef87e6cb1ccf298e0959e98d351 (patch) | |
tree | 210a79b40e525f4040e69cf54e578cf594257370 /spec | |
parent | 46aead4739e079345b47b131f046775d515b332f (diff) | |
parent | 95d7e474e454c79c7b6d73d96e36547e2f1f0e35 (diff) | |
download | bundler-3aa03910cdc95ef87e6cb1ccf298e0959e98d351.tar.gz |
Merge #7404
7404: Support multiple groups for --without-group and --only-group options … r=deivid-rodriguez a=fatkodima
This is a reworked version of #6939
It accepts multiple groups for `--without-group` and `--only-group`.
Closes #6939
Co-authored-by: fatkodima <fatkodima123@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/list_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/commands/list_spec.rb b/spec/commands/list_spec.rb index 71d2136d38..60efd38cb7 100644 --- a/spec/commands/list_spec.rb +++ b/spec/commands/list_spec.rb @@ -24,6 +24,7 @@ RSpec.describe "bundle list" do gem "rack" gem "rspec", :group => [:test] + gem "rails", :group => [:production] G end @@ -32,6 +33,7 @@ RSpec.describe "bundle list" do bundle! "list --without-group test" expect(out).to include(" * rack (1.0.0)") + expect(out).to include(" * rails (2.3.2)") expect(out).not_to include(" * rspec (1.2.7)") end end @@ -43,6 +45,16 @@ RSpec.describe "bundle list" do expect(err).to eq "`random` group could not be found." end end + + context "when multiple groups" do + it "prints the gems not in the specified groups" do + bundle! "list --without-group test production" + + expect(out).to include(" * rack (1.0.0)") + expect(out).not_to include(" * rails (2.3.2)") + expect(out).not_to include(" * rspec (1.2.7)") + end + end end describe "with only-group option" do @@ -52,6 +64,7 @@ RSpec.describe "bundle list" do gem "rack" gem "rspec", :group => [:test] + gem "rails", :group => [:production] G end @@ -71,6 +84,16 @@ RSpec.describe "bundle list" do expect(err).to eq "`random` group could not be found." end end + + context "when multiple groups" do + it "prints the gems in the specified groups" do + bundle! "list --only-group default production" + + expect(out).to include(" * rack (1.0.0)") + expect(out).to include(" * rails (2.3.2)") + expect(out).not_to include(" * rspec (1.2.7)") + end + end end context "with name-only option" do |