Commit 63f240ea authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Resolver] Shows an informative error message when there is no base…

[Resolver] Shows an informative error message when there is no base specification found for a `:head` dependency.

Closes https://github.com/CocoaPods/CocoaPods/issues/3230.
parent 7b323678
...@@ -29,6 +29,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -29,6 +29,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Boris Bügling](https://github.com/neonichu) [Boris Bügling](https://github.com/neonichu)
[#3193](https://github.com/CocoaPods/CocoaPods/issues/3193) [#3193](https://github.com/CocoaPods/CocoaPods/issues/3193)
* Shows an informative error message when there is no base specification found
for a `:head` dependency.
[Samuel Giddins](https://github.com/segiddins)
[#3230](https://github.com/CocoaPods/CocoaPods/issues/3230)
## 0.36.0.rc.1 ## 0.36.0.rc.1
......
...@@ -311,7 +311,7 @@ module Pod ...@@ -311,7 +311,7 @@ module Pod
else else
set = create_set_from_sources(dependency) set = create_set_from_sources(dependency)
end end
if dependency.head? if set && dependency.head?
set = Specification::Set::Head.new(set.specification) set = Specification::Set::Head.new(set.specification)
end end
cached_sets[name] = set cached_sets[name] = set
......
...@@ -320,6 +320,17 @@ module Pod ...@@ -320,6 +320,17 @@ module Pod
config.sandbox.head_pod?('JSONKit').should.be.true config.sandbox.head_pod?('JSONKit').should.be.true
end end
it 'raises when unable to find a base spec for a HEAD dependency' do
podfile = Podfile.new do
platform :ios, '7.0'
pod 'ALEKit', :head
end
resolver = Resolver.new(config.sandbox, podfile, empty_graph, SourcesManager.all)
Source::Aggregate.any_instance.stubs(:search).with(Dependency.new('ALEKit', :head)).returns(nil)
e = should.raise(Informative) { resolver.resolve.values.flatten.map(&:to_s) }
e.message.should.match /Unable to find a specification for `ALEKit \(HEAD\)`/
end
it 'raises if it finds two conflicting explicit dependencies' do it 'raises if it finds two conflicting explicit dependencies' 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