Commit c8739700 authored by Ben Asher's avatar Ben Asher

fixed up use_frameworks message. added unit spec for it

parent f9f11aeb
......@@ -245,7 +245,7 @@ module Pod
return if extension_uuids.empty?
extension_aggregate_targets.each do |extension_target|
next unless extension_uuids.include? extension_target.user_targets[0].uuid
raise "#{aggregate_target.name} must use_frameworks! because it is hosting an extension." unless aggregate_target.requires_frameworks?
raise Informative, "#{aggregate_target.name} must call use_frameworks! because it is hosting an extension that calls use_frameworks!." unless aggregate_target.requires_frameworks?
pod_target_names = aggregate_target.pod_targets.map(&:name)
# This extension target is hosted by the aggregate target's user_target; copy over the non-duplicate pod_targets
aggregate_target.pod_targets = aggregate_target.pod_targets + extension_target.pod_targets.select do |pod_target|
......
......@@ -711,7 +711,7 @@ module Pod
].sort
end
it "raises exception when unable to find an extension's host target" do
it "raises when unable to find an extension's host target" do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
use_frameworks!
......@@ -727,6 +727,27 @@ module Pod
analyzer.analyze
end.message.should.match /Unable to find host target for Pods-Today Extension. Please add the host targets for the extensions to the Podfile/
end
it "raises when the extension calls use_frameworks!, but the host target does not" do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
platform :ios, '6.0'
project 'Sample Extensions Project/Sample Extensions Project'
target 'Sample Extensions Project' do
pod 'JSONKit', '1.4'
end
target 'Today Extension' do
use_frameworks!
pod 'monkey'
end
end
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
should.raise Informative do
analyzer.analyze
end.message.should.match /Pods-Sample Extensions Project must call use_frameworks! because it is hosting an extension that calls use_frameworks!/
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