Commit dd3663c5 authored by Marius Rackwitz's avatar Marius Rackwitz

[TargetInspector] Quote each enumerated link_with target separately

parent f2201b0f
...@@ -96,7 +96,8 @@ module Pod ...@@ -96,7 +96,8 @@ module Pod
native_targets = user_project.native_targets native_targets = user_project.native_targets
if link_with = target_definition.link_with if link_with = target_definition.link_with
targets = native_targets.select { |t| link_with.include?(t.name) } targets = native_targets.select { |t| link_with.include?(t.name) }
raise Informative, "Unable to find the targets named `#{link_with.to_sentence}` to link with target definition `#{target_definition.name}`" if targets.empty? raise Informative, "Unable to find the targets named #{link_with.map { |x| "`#{x}`" }.to_sentence}" \
"to link with target definition `#{target_definition.name}`" if targets.empty?
elsif target_definition.link_with_first_target? elsif target_definition.link_with_first_target?
targets = [native_targets.first].compact targets = [native_targets.first].compact
raise Informative, 'Unable to find a target' if targets.empty? raise Informative, 'Unable to find a target' if targets.empty?
......
...@@ -71,12 +71,12 @@ module Pod ...@@ -71,12 +71,12 @@ module Pod
it 'raises if it is unable to find the targets specified by the target definition' do it 'raises if it is unable to find the targets specified by the target definition' do
target_definition = Podfile::TargetDefinition.new(:default, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.link_with = ['UserTarget'] target_definition.link_with = %w(UserTarget AnotherUserTarget)
user_project = Xcodeproj::Project.new('path') user_project = Xcodeproj::Project.new('path')
target_inspector = TargetInspector.new(target_definition, config.installation_root) target_inspector = TargetInspector.new(target_definition, config.installation_root)
e = lambda { target_inspector.send(:compute_targets, user_project) }.should.raise Informative e = lambda { target_inspector.send(:compute_targets, user_project) }.should.raise Informative
e.message.should.match /Unable to find the targets/ e.message.should.match /Unable to find the targets named `UserTarget` and `AnotherUserTarget`/
end end
it 'returns the target with the same name of the target definition' do it 'returns the target with the same name of the target definition' 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