diff options
author | Andre Arko <andre@arko.net> | 2010-04-19 23:18:07 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-04-19 23:23:23 -0700 |
commit | 20d36fd9a575a88f3b13f8ac6f3fd2bcf9482ea6 (patch) | |
tree | c2353bc163fb01583e8952cf690d6a53800a21f4 /spec/install/gems/simple_case_spec.rb | |
parent | 9f52e40ede427423afce379f208aacc3854de145 (diff) | |
download | bundler-20d36fd9a575a88f3b13f8ac6f3fd2bcf9482ea6.tar.gz |
Fetch full arch from RemoteSpecifications before installing
It turns out quick gem indexes don't include the arch in the platform
string. So we have to fetch the full spec before we install or risk
trying to install the wrong arch.
You'll need to `rm -rf tmp/gems/base` for this to pass the first time.
Cleanups or suggestions on how to make this spec less ugly would also
be welcome.
Closes #277
Diffstat (limited to 'spec/install/gems/simple_case_spec.rb')
-rw-r--r-- | spec/install/gems/simple_case_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb index 6b848fdacd..58cbb46346 100644 --- a/spec/install/gems/simple_case_spec.rb +++ b/spec/install/gems/simple_case_spec.rb @@ -395,4 +395,36 @@ describe "bundle install with gem sources" do err.should be_empty end end + + describe "when the gem has an architecture in its platform" do + it "still installs correctly" do + gemfile <<-G + # Set up pretend http gem server with FakeWeb + $LOAD_PATH.unshift '#{Dir[base_system_gems.join("gems/fakeweb*/lib")].first}' + require 'fakeweb' + FakeWeb.allow_net_connect = false + files = [ 'specs.4.8.gz', + 'quick/Marshal.4.8/rcov-1.0-mswin32.gemspec.rz', + 'gems/rcov-1.0-mswin32.gem' ] + files.each do |file| + FakeWeb.register_uri(:get, "http://localgemserver.com/\#{file}", + :body => File.read("#{gem_repo1}/\#{file}")) + end + + missing = [ 'prerelease_specs.4.8.gz', + 'gems/rcov-1.0-x86-mswin32.gem' ] + missing.each do |missing| + FakeWeb.register_uri(:get, "http://localgemserver.com/\#{missing}", + :status => ["404", "Not Found"]) + end + + # Try to install gem with nil arch + source "http://localgemserver.com/" + Gem.platforms = [#{mswin}] + gem "rcov" + G + bundle :install + should_be_installed "rcov 1.0.0" + end + end end |