Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Closes #822
  • Loading branch information...
commit 3e52bd6fa1b2aac379fd22e0d4503644f7e92b02 1 parent 42939ed
@indirect indirect authored
View
2  lib/bundler/rubygems_ext.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
View
33 spec/resolver/platform_spec.rb
@@ -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,14 +13,14 @@
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"
@@ -28,6 +28,31 @@
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
7 spec/support/indexes.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.