Commit f051e278 authored by Marius Rackwitz's avatar Marius Rackwitz

[Target] Ensure that Target#archs is always initialized as array

parent 0c7f0228
......@@ -67,7 +67,7 @@ module Pod
def custom_build_settings
settings = {}
unless target.nil? || target.archs.empty?
unless target.archs.empty?
settings['ARCHS'] = target.archs
end
......
......@@ -16,6 +16,12 @@ module Pod
attr_accessor :host_requires_frameworks
alias_method :host_requires_frameworks?, :host_requires_frameworks
# Initialize a new target
#
def initialize
@archs = []
end
# @return [String] the name of the library.
#
def name
......@@ -105,7 +111,7 @@ module Pod
#
attr_accessor :native_target
# @return [String] The value for the ARCHS build setting.
# @return [Array<String>] The value for the ARCHS build setting.
#
attr_accessor :archs
......
......@@ -13,6 +13,7 @@ module Pod
# @param [Sandbox] sandbox @see sandbox
#
def initialize(target_definition, sandbox)
super()
@target_definition = target_definition
@sandbox = sandbox
@pod_targets = []
......
......@@ -41,6 +41,7 @@ module Pod
def initialize(specs, target_definitions, sandbox, scoped = false)
raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty?
super()
@specs = specs
@target_definitions = target_definitions
@sandbox = sandbox
......
......@@ -13,6 +13,10 @@ module Pod
@target.target_definition.should == @target_definition
end
it 'is initialized with empty archs' do
@target.archs.should == []
end
it 'returns the label of the target definition' do
@target.label.should == 'Pods'
end
......
......@@ -24,6 +24,10 @@ module Pod
@pod_target.target_definitions.should == [@target_definition]
end
it 'is initialized with empty archs' do
@pod_target.archs.should == []
end
it 'returns its name' do
@pod_target.name.should == 'BananaLib'
@pod_target.scoped.first.name.should == 'Pods-BananaLib'
......
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