summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2016-03-17 00:19:19 -0400
committerJames Wen <jrw2175@columbia.edu>2016-03-17 20:49:33 -0400
commitaf63dda774f5a891230e5c2d2e2dfd4357c0bc82 (patch)
treec85360b50a608fdbe5cab1b052fdb372804ed07a
parente7e9df172773d1be79764b51bbaa65ed8bfd548d (diff)
downloadbundler-af63dda774f5a891230e5c2d2e2dfd4357c0bc82.tar.gz
Create invalid gemspec error message spec that runs locally
- Move invalid gemspec spec involving resque-scheduler 2.2.0 created in #4283 to realworld specs
-rw-r--r--spec/install/gems/standalone_spec.rb22
-rw-r--r--spec/realworld/edgecases_spec.rb9
2 files changed, 28 insertions, 3 deletions
diff --git a/spec/install/gems/standalone_spec.rb b/spec/install/gems/standalone_spec.rb
index a74e9175d1..04ec15e215 100644
--- a/spec/install/gems/standalone_spec.rb
+++ b/spec/install/gems/standalone_spec.rb
@@ -306,15 +306,31 @@ describe "bundle install --standalone" do
describe "with gem that has an invalid gemspec" do
before do
+ build_git "bar", :gemspec => false do |s|
+ s.write "lib/bar/version.rb", %(BAR_VERSION = '1.0')
+ s.write "bar.gemspec", <<-G
+ lib = File.expand_path('../lib/', __FILE__)
+ $:.unshift lib unless $:.include?(lib)
+ require 'bar/version'
+
+ Gem::Specification.new do |s|
+ s.name = 'bar'
+ s.version = BAR_VERSION
+ s.summary = 'Bar'
+ s.files = Dir["lib/**/*.rb"]
+ s.author = 'Anonymous'
+ s.require_path = [1,2]
+ end
+ G
+ end
install_gemfile <<-G, :standalone => true
- source 'https://rubygems.org'
- gem "resque-scheduler", "2.2.0"
+ gem "bar", :git => "#{lib_path("bar-1.0")}"
G
end
it "outputs a helpful error message" do
expect(out).to include("You have one or more invalid gemspecs that need to be fixed.")
- expect(out).to include("resque-scheduler 2.2.0 has an invalid gemspec")
+ expect(out).to include("bar 1.0 has an invalid gemspec")
end
end
end
diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb
index 2f0ba9866a..89de134cc4 100644
--- a/spec/realworld/edgecases_spec.rb
+++ b/spec/realworld/edgecases_spec.rb
@@ -220,4 +220,13 @@ describe "real world edgecases", :realworld => true, :sometimes => true do
expect(err).to eq("")
expect(exitstatus).to eq(0) if exitstatus
end
+
+ it "outputs a helpful error message when gems have invalid gemspecs" do
+ install_gemfile <<-G, :standalone => true
+ source 'https://rubygems.org'
+ gem "resque-scheduler", "2.2.0"
+ G
+ expect(out).to include("You have one or more invalid gemspecs that need to be fixed.")
+ expect(out).to include("resque-scheduler 2.2.0 has an invalid gemspec")
+ end
end