summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-06 17:45:40 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-06 17:45:40 -0700
commit2332b7a8fa1f4e597f100a74df1a32ecb79b5fa8 (patch)
treee6026043c2e1adc63d2e648d969f5aed33cf9731
parentc0e5a90023651d2b97d42e0c64c13f5aff27bc1e (diff)
downloadbundler-2332b7a8fa1f4e597f100a74df1a32ecb79b5fa8.tar.gz
Correctly handle case of a gem with multiple requirements in a dependency
-rw-r--r--lib/bundler/resolver.rb2
-rw-r--r--spec/install/gems/simple_case_spec.rb18
-rw-r--r--spec/support/builders.rb4
3 files changed, 23 insertions, 1 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index f95f4a6d37..5852d87e23 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -344,7 +344,7 @@ module Bundler
def search(dep)
if base = @base[dep.name] and base.any?
- d = Gem::Dependency.new(base.first.name, *[dep.requirement, base.first.version].flatten)
+ d = Gem::Dependency.new(base.first.name, *[dep.requirement.as_list, base.first.version].flatten)
else
d = dep.dep
end
diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb
index 41ecd797ed..126d973794 100644
--- a/spec/install/gems/simple_case_spec.rb
+++ b/spec/install/gems/simple_case_spec.rb
@@ -468,6 +468,24 @@ describe "bundle install with gem sources" do
out.should == nice_error
end
+ it "works for gems with multiple versions in its dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+
+ gem "multiple_versioned_deps"
+ G
+
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+
+ gem "multiple_versioned_deps"
+ gem "rack"
+ G
+
+ puts out
+ end
+
it "includes bundler in the bundle when it's a child dependency" do
install_gemfile <<-G
source "file://#{gem_repo2}"
diff --git a/spec/support/builders.rb b/spec/support/builders.rb
index 6bcb42cb18..65d0cf8f06 100644
--- a/spec/support/builders.rb
+++ b/spec/support/builders.rb
@@ -110,6 +110,10 @@ module Spec
build_gem "weakling", "0.0.3"
+ build_gem "multiple_versioned_deps" do |s|
+ s.add_dependency "weakling", ">= 0.0.1", "< 0.1"
+ end
+
build_gem "not_released", "1.0.pre"
build_gem "has_prerelease", "1.0"