From 7fff71a7c883783e4ad62605c07934a76dde3b79 Mon Sep 17 00:00:00 2001 From: "fotanus@gmail.com" Date: Wed, 13 May 2015 17:55:55 -0300 Subject: [PATCH] Spec that fails with undefined prerelease? for nil --- spec/install/gemfile/gemspec_spec.rb | 10 ++++++++++ spec/support/builders.rb | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 7746e459d57..f2b5acfbdd9 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -65,6 +65,16 @@ expect(error).to match(/There are no gemspecs at #{tmp.join('foo')}/) end + it "should raise if there is no version on the gemspec" do + build_lib("noversion", "noversion", :path => tmp.join("noversion")) + + error = install_gemfile(<<-G, :expect_err => true) + source "file://#{gem_repo2}" + gemspec :path => '#{tmp.join("noversion")}' + G + expect(error).to match(/version error message/) + end + it "should raise if there are too many gemspecs available" do build_lib("foo", :path => tmp.join("foo")) do |s| s.write("foo2.gemspec", "") diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 1a1c9167794..0d1df4d2e8e 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -441,7 +441,7 @@ def initialize(context, name, version) @name = name @spec = Gem::Specification.new do |s| s.name = name - s.version = version + s.version = version unless version == "noversion" s.summary = "This is just a fake gem for testing" end @files = {}