diff options
author | Carl Lerche <carllerche@mac.com> | 2010-01-31 18:02:02 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-01-31 18:02:02 -0800 |
commit | 32e72a45581d47466f2013659675bb427a5daf93 (patch) | |
tree | 8bc32ac2b9df5e64ff840e0408fac17e27fc2245 /spec | |
parent | 7c15c17dc4680cbb8a367eb7aa605b072cf6d3d5 (diff) | |
download | bundler-32e72a45581d47466f2013659675bb427a5daf93.tar.gz |
Pick the correct platform when installing gems
Diffstat (limited to 'spec')
-rw-r--r-- | spec/install/gems_spec.rb | 11 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/platforms.rb | 15 |
3 files changed, 25 insertions, 3 deletions
diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index 320a6d7f..55a298d1 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -117,10 +117,15 @@ describe "gemfile install with gem sources" do 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" + it "installs gems for the correct platform" do + Gem.platforms = [rb] + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "platform_specific" + G - pending + run "require 'platform_specific' ; puts PLATFORM_SPECIFIC" + out.should == '1.0.0 RUBY' end describe "with extra sources" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e73841c2..35f17985 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,6 +20,7 @@ Spec::Runner.configure do |config| config.include Spec::Matchers config.include Spec::Path config.include Spec::Rubygems + config.include Spec::Platforms original_wd = Dir.pwd original_gem_home = ENV['GEM_HOME'] @@ -35,6 +36,7 @@ Spec::Runner.configure do |config| end config.after :each do + Gem.platforms = nil Dir.chdir(original_wd) ENV['GEM_HOME'] = ENV['GEM_PATH'] = original_gem_home end diff --git a/spec/support/platforms.rb b/spec/support/platforms.rb new file mode 100644 index 00000000..2598488b --- /dev/null +++ b/spec/support/platforms.rb @@ -0,0 +1,15 @@ +module Spec + module Platforms + def rb + Gem::Platform::RUBY + end + + def java + Gem::Platform.new [nil, "java", nil] + end + + def linux + Gem::Platform.new ['x86', 'linux', nil] + end + end +end
\ No newline at end of file |