diff options
author | Homu <homu@barosl.com> | 2016-03-23 01:45:42 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-03-23 01:45:42 +0900 |
commit | 65fe6b0f62c7ca115097cb55672dcd6b4ac824bf (patch) | |
tree | 8ce31debd55d26f4fd17a1074d0bd03dc1424869 | |
parent | 8edd87c82cde769bd5114a947bba656bdf90a26d (diff) | |
parent | af63dda774f5a891230e5c2d2e2dfd4357c0bc82 (diff) | |
download | bundler-65fe6b0f62c7ca115097cb55672dcd6b4ac824bf.tar.gz |
Auto merge of #4377 - RochesterinNYC:create-local-invalid-gemspec-error-spec, r=segiddins
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
- Related to [comments here](https://github.com/bundler/bundler/commit/a753d0182e6d4d91d7e401e40482c6cec5baadae#commitcomment-16716088)
-rw-r--r-- | spec/install/gems/standalone_spec.rb | 22 | ||||
-rw-r--r-- | spec/realworld/edgecases_spec.rb | 9 |
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 |