Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Set opts["platform"] to the mutated platforms in the normalization me…
Browse files Browse the repository at this point in the history
…thod, not the original value
  • Loading branch information
wycats committed Sep 9, 2010
1 parent 26bd845 commit 79a0514
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/dsl.rb
Expand Up @@ -226,7 +226,7 @@ def _normalize_options(name, version, opts)

opts["source"] ||= @source
opts["env"] ||= @env
opts["platforms"] = @platforms.dup
opts["platforms"] = platforms.dup
opts["group"] = groups
end

Expand Down
31 changes: 29 additions & 2 deletions spec/install/gems/platform_spec.rb
Expand Up @@ -94,7 +94,7 @@
gem "rack", "1.0.0"
G

bundle "install ./vendor"
bundle "install --path vendor"

vendored_gems("gems/rack-1.0.0").should exist
end
Expand All @@ -106,7 +106,7 @@
gem "rack", "1.0.0"
G

bundle "install ./vendor"
bundle "install --path vendor"

new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
FileUtils.mv(vendored_gems, bundled_app("vendor/#{Gem.ruby_engine}/#{new_version}"))
Expand All @@ -130,6 +130,21 @@
should_be_installed "nokogiri 1.4.2"
end

it "does not install gems tagged w/ another platform" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
platforms :#{not_local_tag} do
gem "nokogiri"
end
G

should_be_installed "rack 1.0"
should_not_be_installed "nokogiri 1.4.2"
end

it "installs gems tagged w/ the current platform" do
install_gemfile <<-G
source "file://#{gem_repo1}"
Expand All @@ -151,4 +166,16 @@

should_not_be_installed "nokogiri"
end

it "does not install gems tagged w/ another platform" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
gem "nokogiri", :platforms => :#{not_local_tag}
G

should_be_installed "rack 1.0"
should_not_be_installed "nokogiri 1.4.2"
end
end

0 comments on commit 79a0514

Please sign in to comment.