summaryrefslogtreecommitdiff
path: root/spec/bundler/dsl_spec.rb
diff options
context:
space:
mode:
authorColby Swandale <colby@taplaboratories.com>2017-07-25 16:48:59 +1000
committerColby Swandale <colby@taplaboratories.com>2017-07-25 16:50:12 +1000
commited70c04df3bbf505990fbd35e731543fd3e74205 (patch)
tree81ba6da740908213b705f3a9cc689d161d3b0172 /spec/bundler/dsl_spec.rb
parent219ea82fd4c84fcf047fc4cd957147600902288e (diff)
downloadbundler-ed70c04df3bbf505990fbd35e731543fd3e74205.tar.gz
add more clear error message for user when adding a gem in the Gemfile with an empty namecolby/gem-empty-name-validation
Diffstat (limited to 'spec/bundler/dsl_spec.rb')
-rw-r--r--spec/bundler/dsl_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb
index 080723ac83..270ebe9680 100644
--- a/spec/bundler/dsl_spec.rb
+++ b/spec/bundler/dsl_spec.rb
@@ -110,6 +110,11 @@ RSpec.describe Bundler::Dsl do
to raise_error(Bundler::GemfileError, /is not a valid platform/)
end
+ it "rejects empty gem name" do
+ expect { subject.gem("") }.
+ to raise_error(Bundler::GemfileError, /an empty gem name is not valid/)
+ end
+
it "rejects with a leading space in the name" do
expect { subject.gem(" foo") }.
to raise_error(Bundler::GemfileError, /' foo' is not a valid gem name because it contains whitespace/)