summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-06-16 16:34:14 -0700
committerwycats <wycats@gmail.com>2010-06-29 14:44:45 -0700
commitf1d7e4fe3c2cb392405ac20fece81a0d74a1971c (patch)
tree63631106959c704195b102f7f39d9615b6be00a1
parentd68b98b061eafef31de7fab382c7f4d6f42974c4 (diff)
downloadbundler-f1d7e4fe3c2cb392405ac20fece81a0d74a1971c.tar.gz
Fix specs, no-color option, and resolver error indentation
-rw-r--r--lib/bundler/resolver.rb15
-rw-r--r--spec/install/gems/flex_spec.rb2
-rw-r--r--spec/other/check_spec.rb7
-rw-r--r--spec/support/helpers.rb2
4 files changed, 12 insertions, 14 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index d2d81c4b32..5dc3d6a4ff 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -379,11 +379,9 @@ module Bundler
def error_message
output = errors.inject("") do |o, (conflict, (origin, requirement))|
- o << "Bundler could not find compatible versions for gem #{conflict.inspect}:\n"
-
-
if origin
+ o << "Bundler could not find compatible versions for gem #{conflict.inspect}:\n"
o << " In Gemfile:\n"
if requirement.required_by.first
o << " #{clean_req(requirement.required_by.first)} depends on\n"
@@ -399,17 +397,18 @@ module Bundler
if origin.required_by.first && origin.required_by.first.name != origin.name
o << " #{clean_req(origin.required_by.first)} depends on\n"
- o << " #{origin.name} (#{origin.version})\n"
+ o << " #{origin.name} (#{clean_req(origin.version)})\n"
else
- o << " #{origin.name} (#{origin.version})\n"
+ o << " #{origin.name} (#{clean_req(origin.version)})\n"
end
else
if @base[conflict].any?
+ o << "Bundler could not find compatible versions for gem #{conflict.inspect}:\n"
locked = @base[conflict].first
o << " In snapshot (Gemfile.lock):\n"
- o << " #{conflict} (#{locked.version})\n\n"
+ o << " #{conflict} (#{clean_req(locked.version)})\n\n"
o << " In Gemfile:\n"
if requirement.required_by.first
@@ -419,10 +418,8 @@ module Bundler
o << " #{clean_req(requirement)}\n"
end
o << "\nRunning `bundle update` will try to resolve the conflict between your Gemfile and snapshot.\n"
-
else
- o << "Could not find the gem #{clean_req(requirement)}\n"
- o << " required by #{clean_req(requirement.required_by.first)}\n"
+ o << "Could not find the gem '#{clean_req(requirement)}', required by gem '#{clean_req(requirement.required_by.first)}'\n"
end
end
diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb
index 2b14d8185b..75404f5749 100644
--- a/spec/install/gems/flex_spec.rb
+++ b/spec/install/gems/flex_spec.rb
@@ -199,7 +199,7 @@ describe "bundle flex_install" do
rack (0.9.1)
In Gemfile:
- rack-obama (= 2.0, runtime)
+ rack-obama (= 2.0)
rack (= 1.2)
Running `bundle update` will try to resolve the conflict between your Gemfile and snapshot.
diff --git a/spec/other/check_spec.rb b/spec/other/check_spec.rb
index 848c50767c..5b6dd5160a 100644
--- a/spec/other/check_spec.rb
+++ b/spec/other/check_spec.rb
@@ -30,8 +30,9 @@ describe "bundle check" do
G
bundle :check
- out.should include('not_here (>= 0, runtime) not found in any of the sources')
- out.should include('required by missing_dep (>= 0, runtime)')
+ puts out
+ out.should include(%{Could not find the gem 'not_here'})
+ out.should include(%{required by gem 'missing_dep'})
end
it "provides debug information when there is a resolving problem" do
@@ -51,7 +52,7 @@ describe "bundle check" do
G
bundle :check
- out.should include('Conflict on: "activesupport"')
+ out.should include(%{could not find compatible versions for gem "activesupport"})
end
it "remembers --without option from install" do
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index d870bbf09e..859b3337f5 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -46,7 +46,7 @@ module Spec
def bundle(cmd, options = {})
expect_err = options.delete(:expect_err)
exit_status = options.delete(:exit_status)
- options["no-color"] = true unless options.key?("no-color")
+ options["no-color"] = true unless options.key?("no-color") || cmd.to_s[0..3] == "exec"
env = (options.delete(:env) || {}).map{|k,v| "#{k}='#{v}' "}.join
args = options.map do |k,v|