Commit 187c93b2 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ResolverSpec] Add specs for empty podfile and 3-way conflict

parent 2a4df8e3
...@@ -18,7 +18,7 @@ GIT ...@@ -18,7 +18,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Molinillo.git remote: https://github.com/CocoaPods/Molinillo.git
revision: b66281386b4d226801afc8fd02cb6514c80b81b6 revision: 9e8ae0cc7fe3534b64555a4a4312c3c741824d2a
branch: master branch: master
specs: specs:
molinillo (0.0.1) molinillo (0.0.1)
......
...@@ -60,6 +60,15 @@ module Pod ...@@ -60,6 +60,15 @@ module Pod
specs = resolver.specs_by_target.values.flatten specs = resolver.specs_by_target.values.flatten
specs.map(&:to_s).should == ['Reachability (3.0.0)'] specs.map(&:to_s).should == ['Reachability (3.0.0)']
end end
it 'resolves an empty podfile' do
@podfile = Podfile.new do
platform :ios
end
resolver = Resolver.new(config.sandbox, @podfile, [], SourcesManager.all)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should == []
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
...@@ -100,6 +109,20 @@ module Pod ...@@ -100,6 +109,20 @@ module Pod
'RestKit/Support (0.20.1)', 'SOCKit (1.1)', 'TransitionKit (1.1.0)'] 'RestKit/Support (0.20.1)', 'SOCKit (1.1)', 'TransitionKit (1.1.0)']
end end
it 'resolves three-way conflicts' do
@podfile = Podfile.new do
platform :ios, '7.0'
pod 'AFAmazonS3Client' # latest version (2.0.0) requires 'AFNetworking', '~> 2.0'
pod 'CargoBay' # latest version (2.1.0) requires 'AFNetworking', '~> 2.2'
pod 'AFOAuth2Client' # latest version (0.1.2) requires 'AFNetworking', '~> 1.3'
end
resolver = Resolver.new(config.sandbox, @podfile, [], SourcesManager.all)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should == ['AFAmazonS3Client (1.0.1)', 'AFNetworking (1.3.4)',
'AFOAuth2Client (0.1.2)', 'CargoBay (1.0.0)']
end
it 'holds the context state, such as cached specification sets' do it 'holds the context state, such as cached specification sets' do
@resolver.resolve @resolver.resolve
cached_sets = @resolver.send(:cached_sets) cached_sets = @resolver.send(:cached_sets)
...@@ -253,35 +276,6 @@ module Pod ...@@ -253,35 +276,6 @@ module Pod
version.to_s.should == '1.4' version.to_s.should == '1.4'
end end
xit 'takes into account locked implicit dependencies' do
podfile = Podfile.new do
platform :ios, '8.0'
pod 'ARAnalytics/Mixpanel'
end
lockfile_yaml = <<-EOS
PODS:
- ARAnalytics/CoreIOS (2.8.0)
- ARAnalytics/Mixpanel (2.8.0):
- ARAnalytics/CoreIOS
- Mixpanel
- Mixpanel (2.5.1)
DEPENDENCIES:
- ARAnalytics/Mixpanel
SPEC CHECKSUMS:
ARAnalytics: 93c5b65989145f88f4d45e262612eac277b0c219
Mixpanel: 0115466ba70fd12e67ac4d3d071408dd1d489657
COCOAPODS: 0.33.1
EOS
lockfile = Lockfile.new(YAMLHelper.load_string(lockfile_yaml))
resolver = Resolver.new(config.sandbox, podfile, lockfile.dependencies, SourcesManager.master)
resolver.resolve.values.first.
find { |s| s.name == 'Mixpanel' }.
version.to_s.should == '2.5.1'
end
it 'consults all sources when finding a matching spec' do it 'consults all sources when finding a matching spec' do
podfile = Podfile.new do podfile = Podfile.new do
platform :ios platform :ios
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment