summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--spec/bundler/commands/add_spec.rb12
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 6ee86b182f..8db725bbde 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -347,7 +347,7 @@ module Bundler
method_option "github", type: :string
method_option "branch", type: :string
method_option "ref", type: :string
- method_option "glob", type: :string
+ method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb
index 93d5ea7239..36e286793b 100644
--- a/spec/bundler/commands/add_spec.rb
+++ b/spec/bundler/commands/add_spec.rb
@@ -177,7 +177,7 @@ RSpec.describe "bundle add" do
describe "with --git and --glob" do
it "adds dependency with specified git source" do
- bundle "add foo --git=#{lib_path("foo-2.0")} --glob=./*.gemspec"
+ bundle "add foo --git=#{lib_path("foo-2.0")} --glob='./*.gemspec'"
expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :glob => "\./\*\.gemspec"})
expect(the_bundle).to include_gems "foo 2.0"
@@ -190,7 +190,7 @@ RSpec.describe "bundle add" do
end
it "adds dependency with specified git source and branch" do
- bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test --glob=./*.gemspec"
+ bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test --glob='./*.gemspec'"
expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :branch => "test", :glob => "\./\*\.gemspec"})
expect(the_bundle).to include_gems "foo 2.0"
@@ -199,7 +199,7 @@ RSpec.describe "bundle add" do
describe "with --git and --ref and --glob" do
it "adds dependency with specified git source and branch" do
- bundle "add foo --git=#{lib_path("foo-2.0")} --ref=#{revision_for(lib_path("foo-2.0"))} --glob=./*.gemspec"
+ bundle "add foo --git=#{lib_path("foo-2.0")} --ref=#{revision_for(lib_path("foo-2.0"))} --glob='./*.gemspec'"
expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2\.0", :git => "#{lib_path("foo-2.0")}", :ref => "#{revision_for(lib_path("foo-2.0"))}", :glob => "\./\*\.gemspec"})
expect(the_bundle).to include_gems "foo 2.0"
@@ -208,7 +208,7 @@ RSpec.describe "bundle add" do
describe "with --github and --glob" do
it "adds dependency with specified github source", :realworld do
- bundle "add rake --github=ruby/rake --glob=./*.gemspec"
+ bundle "add rake --github=ruby/rake --glob='./*.gemspec'"
expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :glob => "\.\/\*\.gemspec"})
end
@@ -216,7 +216,7 @@ RSpec.describe "bundle add" do
describe "with --github and --branch --and glob" do
it "adds dependency with specified github source and branch", :realworld do
- bundle "add rake --github=ruby/rake --branch=master --glob=./*.gemspec"
+ bundle "add rake --github=ruby/rake --branch=master --glob='./*.gemspec'"
expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :branch => "master", :glob => "\.\/\*\.gemspec"})
end
@@ -224,7 +224,7 @@ RSpec.describe "bundle add" do
describe "with --github and --ref and --glob" do
it "adds dependency with specified github source and ref", :realworld do
- bundle "add rake --github=ruby/rake --ref=5c60da8 --glob=./*.gemspec"
+ bundle "add rake --github=ruby/rake --ref=5c60da8 --glob='./*.gemspec'"
expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :ref => "5c60da8", :glob => "\.\/\*\.gemspec"})
end