Commit 31d25e71 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ResolverSpec] Make specs for conflict messages more precise

parent 01b2fa5b
......@@ -18,7 +18,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Resolver.git
revision: 8241b8f2079928cd4fc58416e8c7796811d541c6
revision: 8f5241546ce3f67756d87547154b88445b306933
branch: master
specs:
resolver (0.0.1)
......
......@@ -118,8 +118,14 @@ module Pod
dependency.name
end
def name_for_explicit_dependency_source
'Podfile'
end
def requirement_satisfied_by?(requirement, activated, spec)
existing = activated.vertices.values.map(&:payload).compact.find { |s| Specification.root_name(s.name) == Specification.root_name(requirement.name) }
existing = activated.vertices.values.map(&:payload).compact.find do |s|
Specification.root_name(s.name) == Specification.root_name(requirement.name)
end
if existing
existing.version == spec.version &&
requirement.requirement.satisfied_by?(spec.version)
......
......@@ -194,15 +194,30 @@ module Pod
config.sandbox.head_pod?('JSONKit').should.be.true
end
it 'raises if it finds two conflicting dependencies' do
it 'raises if it finds two conflicting explicit dependencies' do
podfile = Podfile.new do
platform :ios
pod 'JSONKit', '1.4'
pod 'JSONKit', '1.5pre'
end
resolver = Resolver.new(config.sandbox, podfile, [], SourcesManager.all)
e = lambda { resolver.resolve }.should.raise Pod::Informative
e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/Unable to satisfy the following requirements/)
e.message.should.match(/`JSONKit \(= 1.4\)` required by `Podfile`/)
e.message.should.match(/`JSONKit \(= 1.5pre\)` required by `Podfile`/)
end
it 'raises if it finds two conflicting dependencies' do
podfile = Podfile.new do
platform :ios
pod 'RestKit', '0.23.3' # dependends on AFNetworking ~> 1.3.0
pod 'AFNetworking', '> 2'
end
resolver = Resolver.new(config.sandbox, podfile, [], SourcesManager.all)
e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/Unable to satisfy the following requirements/)
e.message.should.match(/`AFNetworking \(~> 1.3.0\)` required by `RestKit\/Network \(.*\)`/)
e.message.should.match(/`AFNetworking \(> 2\)` required by `Podfile`/)
end
it 'takes into account locked dependencies' do
......
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