aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-05-13 12:01:41 -0700
committerAndre Arko <andre@arko.net>2015-05-13 12:01:41 -0700
commit654e44a1febe1ebc89a43bb986a21f4efa653c6c (patch)
tree7a28e7849ba37df5229bc9af982b33405e6fe770 /spec
parentac66cd244af2541eb8f4fc5f6a7dec3ad24cdb09 (diff)
downloadbundler-654e44a1febe1ebc89a43bb986a21f4efa653c6c.tar.gz
validate gemspec specifications (with a test)
closes #3639
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/dsl_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb
index 5c6be9ef..ca97d0c6 100644
--- a/spec/bundler/dsl_spec.rb
+++ b/spec/bundler/dsl_spec.rb
@@ -187,4 +187,18 @@ describe Bundler::Dsl do
to raise_error(Bundler::GemfileError, /There was an error parsing `Gemfile`: can't modify frozen String. Bundler cannot continue./)
end
end
+
+ describe "#gemspec" do
+ it "errors on invalid specs" do
+ File.open(bundled_app("foo.gemspec"), "w") do |f|
+ f.write <<-G
+ Gem::Specification.new do |s|
+ s.name = "foo"
+ end
+ G
+ end
+ expect(Bundler).to receive(:default_gemfile).and_return(bundled_app("Gemfile"))
+ expect { subject.gemspec }.to raise_error(Bundler::InvalidOption).with_message(/missing value for attribute version/)
+ end
+ end
end