Commit 183f2551 authored by Eloy Duran's avatar Eloy Duran

Finish up the specs for what a target should have.

parent 441eac88
......@@ -81,7 +81,7 @@ module Pod
end
class PBXFileReference < PBXObject
attributes :path, :sourceTree
attributes :path, :sourceTree, :explicitFileType, :includeInIndex
def initialize(project, uuid, attributes)
is_new = uuid.nil?
......@@ -190,9 +190,11 @@ module Pod
end
class PBXNativeTarget < PBXObject
attributes :productName, :productType, :buildRules, :dependencies
attributes :productName, :productType
has_many :buildPhases, :class => PBXBuildPhase
has_many :dependencies, :singular => :dependency # TODO :class => ?
has_many :buildRules # TODO :class => ?
has_one :buildConfigurationList
has_one :product, :uuid => :productReference
......@@ -200,8 +202,8 @@ module Pod
super
self.buildPhaseReferences ||= []
# TODO self.buildConfigurationList ||= new list?
#self.buildRules ||= []
#self.dependencies ||= []
self.buildRuleReferences ||= []
self.dependencyReferences ||= []
end
end
......
......@@ -112,7 +112,6 @@ describe "Pod::Xcode::Project" do
end
it "returns the xcconfig that this configuration is based on (baseConfigurationReference)" do
p @project.objects['515160D0141EC5D100EBB823']
xcconfig = @project.objects.new
@configuration.baseConfiguration = xcconfig
@configuration.baseConfigurationReference.should == xcconfig.uuid
......@@ -143,8 +142,13 @@ describe "Pod::Xcode::Project" do
it "returns the product" do
product = @target.product
p product.attributes # TODO continue from here!!
#product.uuid.should == @target.productReference
product.uuid.should == @target.productReference
product.should.be.instance_of Pod::Xcode::Project::PBXFileReference
product.path.should == "libPods.a"
product.name.should == "libPods.a"
product.sourceTree.should == "BUILT_PRODUCTS_DIR"
product.explicitFileType.should == "archive.ar"
product.includeInIndex.should == "0"
end
it "returns that product type is a static library" do
......@@ -154,12 +158,18 @@ describe "Pod::Xcode::Project" do
it "returns the buildConfigurationList" do
list = @target.buildConfigurationList
list.should.be.instance_of Pod::Xcode::Project::XCConfigurationList
list.buildConfigurations.map(&:name).sort.should == %w{ Debug Release }
@target.buildConfigurationListReference = nil
@target.buildConfigurationList.should == nil
@target.buildConfigurationListReference = list.uuid
@target.buildConfigurationList.attributes.should == list.attributes
end
it "returns an empty list of dependencies and buildRules (not sure yet which classes those are yet)" do
@target.dependencies.to_a.should == []
@target.buildRules.to_a.should == []
end
describe "concerning its build phases" do
extend SpecHelper::TemporaryDirectory
......
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