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