Permalink
Browse files

Add x86 CPU back to MINGW platform, with test for future regression

Closes #822
  • Loading branch information...
1 parent 42939ed commit 3e52bd6fa1b2aac379fd22e0d4503644f7e92b02 @indirect indirect committed Nov 12, 2010
Showing with 33 additions and 9 deletions.
  1. +1 −1 lib/bundler/rubygems_ext.rb
  2. +29 −4 spec/resolver/platform_spec.rb
  3. +3 −4 spec/support/indexes.rb
@@ -121,7 +121,7 @@ def to_lock
class Platform
JAVA = Gem::Platform.new('java')
MSWIN = Gem::Platform.new('mswin32')
- MINGW = Gem::Platform.new('mingw32')
+ MINGW = Gem::Platform.new('x86-mingw32')
def hash
@cpu.hash ^ @os.hash ^ @version.hash
@@ -1,7 +1,7 @@
require "spec_helper"
describe "Resolving platform craziness" do
- describe "with semi real cases" do
+ describe "with cross-platform gems" do
before :each do
@index = an_awesome_index
end
@@ -13,21 +13,46 @@
should_resolve_as %w(nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3)
end
- it "doesn't pull gems when it doesn't exist for the current platform" do
+ it "doesn't pull gems that don't exist for the current platform" do
dep "nokogiri"
platforms "ruby"
should_resolve_as %w(nokogiri-1.4.2)
end
- it "doesn't pulls gems when the version is available for all requested platforms" do
+ it "doesn't pull gems when the version is available for all requested platforms" do
dep "nokogiri"
platforms "mswin32"
should_resolve_as %w(nokogiri-1.4.2.1-x86-mswin32)
end
end
+ describe "with mingw32" do
+
+ before :each do
+ @index = build_index do
+ platforms "mingw32 mswin32" do |platform|
+ gem "thin", "1.2.7", platform
+ end
+ end
+ end
+
+ it "finds mswin gems" do
+ # win32 is hardcoded to get CPU x86 in rubygems
+ platforms "mswin32"
+ dep "thin"
+ should_resolve_as %w(thin-1.2.7-x86-mswin32)
+ end
+
+ it "finds mingw gems" do
+ # mingw is _not_ hardcoded to add CPU x86 in rubygems
+ platforms "x86-mingw32"
+ dep "thin"
+ should_resolve_as %w(thin-1.2.7-x86-mingw32)
+ end
+ end
+
describe "with conflicting cases" do
before :each do
@index = build_index do
@@ -47,7 +72,7 @@
end
end
- it "does something" do
+ it "reports on the conflict" do
platforms "ruby", "java"
dep "foo"
View
@@ -26,7 +26,6 @@ def resolve
def should_resolve_as(specs)
got = resolve
got = got.map { |s| s.full_name }.sort
-
got.should == specs.sort
end
@@ -88,17 +87,17 @@ def an_awesome_index
end
versions '1.0 1.2 1.2.1 1.2.2 1.3 1.3.0.1 1.3.5 1.4.0 1.4.2 1.4.2.1' do |version|
- platforms "ruby java mswin32" do |platform|
+ platforms "ruby java mswin32 mingw32" do |platform|
next if version == v('1.4.2.1') && platform != pl('x86-mswin32')
next if version == v('1.4.2') && platform == pl('x86-mswin32')
gem "nokogiri", version, platform do
- dep "weakling", ">= 0.0.3" if platform =~ 'java'
+ dep "weakling", ">= 0.0.3" if platform =~ pl('java')
end
end
end
versions '0.0.1 0.0.2 0.0.3' do |version|
- gem "weakling", version #, pl('java')
+ gem "weakling", version
end
# --- Rails related

0 comments on commit 3e52bd6

Please sign in to comment.