diff options
author | Carl Lerche <carllerche@mac.com> | 2010-01-28 13:50:31 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-01-28 13:50:31 -0800 |
commit | 6e54a209c5e6327cb002857832dcd0860e8c4ca0 (patch) | |
tree | da31f65aacb47c6e630657321b6efc5ad9e4b607 | |
parent | 069df8163002bd312fd9fec98c306b42e3d50a7f (diff) | |
download | bundler-6e54a209c5e6327cb002857832dcd0860e8c4ca0.tar.gz |
Add a failing spec for gem installation
-rw-r--r-- | spec/install/gems_spec.rb | 13 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/builders.rb | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index fa7b6cd691..fa7fc7b56a 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -94,6 +94,19 @@ describe "gemfile install with gem sources" do should_be_installed "rack 1.0.0", "foo 1.0.0" end + it "prioritizes local gems over remote gems" do + build_gem 'rack', '1.0.0', :to_system => true do |s| + s.add_dependency "activesupport", "2.3.5" + end + + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + should_be_installed "rack 1.0.0", "activesupport 2.3.5" + end + it "does not hit the remote source if the gemfile can be satisfied locally" do # system_gems "activesupport-2.3.2" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 675427d8ca..e73841c20b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,6 +4,8 @@ $:.unshift File.expand_path('../../lib', __FILE__) require 'fileutils' require 'rubygems' require 'bundler' +gem 'rspec', '~> 1.3.0' +require 'spec' Dir["#{File.expand_path('../support', __FILE__)}/*.rb"].each do |file| require file diff --git a/spec/support/builders.rb b/spec/support/builders.rb index f470b87d29..c637412ad4 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -300,7 +300,7 @@ module Spec FileUtils.mkdir_p(destination) Gem::Builder.new(@spec).build if opts[:to_system] - `gem install #{@spec.full_name}.gem` + `gem install --ignore-dependencies #{@spec.full_name}.gem` else FileUtils.mv("#{@spec.full_name}.gem", opts[:path] || _default_path) end |