diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-11-18 21:40:05 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-11-19 11:21:49 -0600 |
commit | c7e1542bb71a54ce97bc60d43c86892ec1536be0 (patch) | |
tree | 3457e3649480cdc2b80b7b45f450d5d709387fb9 /spec/commands | |
parent | ec3cacbf870a2d9d9109359063e0dcd94d45732c (diff) | |
download | bundler-c7e1542bb71a54ce97bc60d43c86892ec1536be0.tar.gz |
[CLI::Gem] Fail gracefully on an invalid constant name
Diffstat (limited to 'spec/commands')
-rw-r--r-- | spec/commands/newgem_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 8d14bc41..26dd3b4d 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -733,6 +733,21 @@ describe "bundle gem" do expect(bundled_app("a--a/a--a.gemspec")).to exist end + + it "fails gracefully with a ." do + bundle "gem foo.gemspec" + expect(out).to end_with("Invalid gem name foo.gemspec -- `Foo.gemspec` is an invalid constant name") + end + + it "fails gracefully with a ^" do + bundle "gem ^" + expect(out).to end_with("Invalid gem name ^ -- `^` is an invalid constant name") + end + + it "fails gracefully with a space" do + bundle "gem 'foo bar'" + expect(out).to end_with("Invalid gem name foo bar -- `Foo bar` is an invalid constant name") + end end describe "#ensure_safe_gem_name" do |