summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2016-06-06 23:21:44 -0700
committerSamuel Giddins <segiddins@segiddins.me>2016-08-23 11:50:35 -0500
commitb5c038822229813f01f685afc2e51e7c9ad643be (patch)
treefb491eeb983803ce4ad45aa4a79dc3f002f5749e
parenta160881e6bf9a8145608ab4183f5d2c592d56875 (diff)
downloadbundler-b5c038822229813f01f685afc2e51e7c9ad643be.tar.gz
test for a diagnostic error on ruby version fail
-rw-r--r--spec/install/gems/resolving_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 816799c0f8..90c07adf10 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -119,7 +119,7 @@ describe "bundle install with install-time dependencies" do
end
context "allows no gems" do
- it "does not try to install those gems" do
+ it "raises an error during resolution" do
build_repo2 do
build_gem "require_ruby" do |s|
s.required_ruby_version = "> 9000"
@@ -128,11 +128,23 @@ describe "bundle install with install-time dependencies" do
install_gemfile <<-G
source "file://#{gem_repo2}"
+ ruby "#{RUBY_VERSION}"
gem 'require_ruby'
G
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
- expect(out).to include("require_ruby-1.0 requires ruby version > 9000, which is incompatible with the current version, #{Bundler::RubyVersion.system}")
+
+ nice_error = <<-E.strip.gsub(/^ {8}/, "")
+ Fetching source index from file:#{gem_repo1}/
+ Resolving dependencies...
+ Bundler could not find compatible versions for gem "require_ruby":
+ In Gemfile:
+ ruby (= #{RUBY_VERSION})
+
+ require_ruby was resolved to 1.0, which depends on
+ ruby (> 9000)
+ E
+ expect(out).to eq(nice_error)
end
end
end