Commit 69455ff9 authored by Samuel Giddins's avatar Samuel Giddins

[Outdated] Friendly error when no podspec present for external source deps

parent 26b26f60
......@@ -52,6 +52,7 @@ module Pod
def updates
@updates ||= begin
ensure_external_podspecs_present!
spec_sets.map do |set|
spec = set.specification
source_version = set.versions.first
......@@ -111,6 +112,17 @@ module Pod
config.lockfile
end
end
def ensure_external_podspecs_present!
return unless config.podfile
config.podfile.dependencies.each do |dep|
next if dep.external_source.nil?
unless config.sandbox.specification(dep.root_name)
raise Informative, 'You must run `pod install` first to ensure that the ' \
"podspec for `#{dep.root_name}` has been fetched."
end
end
end
end
end
end
......@@ -78,5 +78,18 @@ module Pod
SourcesManager.expects(:update).never
run_command('outdated', '--no-repo-update')
end
it 'tells the user to run `pod install` when external sources need to be fetched' do
lockfile = mock('Lockfile')
lockfile.stubs(:version).returns(Version.new('1.0'))
lockfile.stubs(:pod_names).returns(%w(AFNetworking))
config.stubs(:lockfile).returns(lockfile)
podfile = Podfile.new do
pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git'
end
config.stubs(:podfile).returns(podfile)
exception = lambda { run_command('outdated', '--no-repo-update') }.should.raise Informative
exception.message.should.include 'You must run `pod install` first to ensure that the podspec for `AFNetworking` has been fetched.'
end
end
end
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