Update specs for root target definitions being abstract by default

parent 910ad461
...@@ -117,7 +117,11 @@ end ...@@ -117,7 +117,11 @@ end
def fixture_target_definition(name = 'Pods', platform = Pod::Platform.ios) def fixture_target_definition(name = 'Pods', platform = Pod::Platform.ios)
platform_hash = { platform.symbolic_name => platform.deployment_target } platform_hash = { platform.symbolic_name => platform.deployment_target }
Pod::Podfile::TargetDefinition.new(name, Pod::Podfile.new, 'name' => name, 'platform' => platform_hash) parent = Pod::Podfile.new
Pod::Podfile::TargetDefinition.new(name, parent,
'abstract' => false,
'name' => name,
'platform' => platform_hash)
end end
def fixture_pod_target(spec_or_name, target_definitions = []) def fixture_pod_target(spec_or_name, target_definitions = [])
......
...@@ -4,8 +4,7 @@ module Pod ...@@ -4,8 +4,7 @@ module Pod
describe Generator::ModuleMap do describe Generator::ModuleMap do
before do before do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil) @pod_target = PodTarget.new([spec], [fixture_target_definition], config.sandbox)
@pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
@gen = Generator::ModuleMap.new(@pod_target) @gen = Generator::ModuleMap.new(@pod_target)
end end
......
...@@ -182,8 +182,8 @@ module Pod ...@@ -182,8 +182,8 @@ module Pod
result = @analyzer.analyze result = @analyzer.analyze
sample_project_target, test_runner_target = result.targets.sort_by(&:name) sample_project_target, test_runner_target = result.targets.sort_by(&:name)
sample_project_target.pod_targets.map(&:name).should == %w(libextobjc) sample_project_target.pod_targets.map(&:name).should == %w(libextobjc-iOS5.0)
test_runner_target.pod_targets.map(&:name).should.be.empty test_runner_target.pod_targets.map(&:name).should == %w(libextobjc-iOS5.1)
sample_project_target.user_targets.map(&:name).should == %w(SampleProject) sample_project_target.user_targets.map(&:name).should == %w(SampleProject)
test_runner_target.user_targets.map(&:name).should == %w(TestRunner) test_runner_target.user_targets.map(&:name).should == %w(TestRunner)
......
...@@ -9,7 +9,7 @@ module Pod ...@@ -9,7 +9,7 @@ module Pod
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
user_project = Xcodeproj::Project.open(SpecHelper.create_sample_app_copy_from_fixture('SampleProject')) user_project = Xcodeproj::Project.open(SpecHelper.create_sample_app_copy_from_fixture('SampleProject'))
user_target = user_project.native_targets.find { |np| np.name == 'SampleProject' } user_target = user_project.native_targets.find { |np| np.name == 'SampleProject' }
target_definition = Podfile::TargetDefinition.new('Pods', nil) target_definition = fixture_target_definition
pod_target = PodTarget.new([spec], [target_definition], config.sandbox) pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
umbrella = AggregateTarget.new(target_definition, config.sandbox) umbrella = AggregateTarget.new(target_definition, config.sandbox)
umbrella.user_project = user_project umbrella.user_project = user_project
......
...@@ -8,6 +8,7 @@ module Pod ...@@ -8,6 +8,7 @@ module Pod
Project.new(config.sandbox.project_path).save Project.new(config.sandbox.project_path).save
@target = @project.targets.first @target = @project.targets.first
target_definition = Podfile::TargetDefinition.new('Pods', nil) target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@pod_bundle = AggregateTarget.new(target_definition, config.sandbox) @pod_bundle = AggregateTarget.new(target_definition, config.sandbox)
@pod_bundle.user_project = @project @pod_bundle.user_project = @project
@pod_bundle.client_root = project_path.dirname @pod_bundle.client_root = project_path.dirname
......
...@@ -13,6 +13,7 @@ module Pod ...@@ -13,6 +13,7 @@ module Pod
Project.new(config.sandbox.project_path).save Project.new(config.sandbox.project_path).save
@target = @project.targets.first @target = @project.targets.first
target_definition = Podfile::TargetDefinition.new('Pods', nil) target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@pod_bundle = AggregateTarget.new(target_definition, config.sandbox) @pod_bundle = AggregateTarget.new(target_definition, config.sandbox)
@pod_bundle.user_project = @project @pod_bundle.user_project = @project
@pod_bundle.client_root = project_path.dirname @pod_bundle.client_root = project_path.dirname
......
...@@ -615,6 +615,7 @@ module Pod ...@@ -615,6 +615,7 @@ module Pod
it 'install the targets of the Pod project' do it 'install the targets of the Pod project' do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.abstract = false
target_definition.store_pod('BananaLib') target_definition.store_pod('BananaLib')
pod_target = PodTarget.new([spec], [target_definition], config.sandbox) pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
@installer.stubs(:aggregate_targets).returns([]) @installer.stubs(:aggregate_targets).returns([])
...@@ -626,6 +627,7 @@ module Pod ...@@ -626,6 +627,7 @@ module Pod
it 'does not skip empty pod targets' do it 'does not skip empty pod targets' do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.abstract = false
pod_target = PodTarget.new([spec], [target_definition], config.sandbox) pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
@installer.stubs(:aggregate_targets).returns([]) @installer.stubs(:aggregate_targets).returns([])
@installer.stubs(:pod_targets).returns([pod_target]) @installer.stubs(:pod_targets).returns([pod_target])
...@@ -660,7 +662,7 @@ module Pod ...@@ -660,7 +662,7 @@ module Pod
before do before do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, @installer.podfile) target_definition = Podfile::TargetDefinition.new(:default, @installer.podfile.root_target_definitions.first)
@pod_target = PodTarget.new([spec], [target_definition], config.sandbox) @pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
@target = AggregateTarget.new(target_definition, config.sandbox) @target = AggregateTarget.new(target_definition, config.sandbox)
......
...@@ -4,7 +4,7 @@ module Pod ...@@ -4,7 +4,7 @@ module Pod
describe Pod::AggregateTarget do describe Pod::AggregateTarget do
describe 'In general' do describe 'In general' do
before do before do
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @target_definition = fixture_target_definition
@lib = AggregateTarget.new(@target_definition, config.sandbox) @lib = AggregateTarget.new(@target_definition, config.sandbox)
end end
...@@ -27,7 +27,7 @@ module Pod ...@@ -27,7 +27,7 @@ module Pod
describe 'Support files' do describe 'Support files' do
before do before do
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @target_definition = fixture_target_definition
@lib = AggregateTarget.new(@target_definition, config.sandbox) @lib = AggregateTarget.new(@target_definition, config.sandbox)
@lib.client_root = config.sandbox.root.dirname @lib.client_root = config.sandbox.root.dirname
end end
......
...@@ -5,6 +5,7 @@ module Pod ...@@ -5,6 +5,7 @@ module Pod
describe 'In general' do describe 'In general' do
before do before do
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@target = AggregateTarget.new(@target_definition, config.sandbox) @target = AggregateTarget.new(@target_definition, config.sandbox)
end end
...@@ -41,6 +42,7 @@ module Pod ...@@ -41,6 +42,7 @@ module Pod
describe 'Support files' do describe 'Support files' do
before do before do
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@target = AggregateTarget.new(@target_definition, config.sandbox) @target = AggregateTarget.new(@target_definition, config.sandbox)
@target.client_root = config.sandbox.root.dirname @target.client_root = config.sandbox.root.dirname
end end
...@@ -86,6 +88,7 @@ module Pod ...@@ -86,6 +88,7 @@ module Pod
before do before do
@spec = fixture_spec('banana-lib/BananaLib.podspec') @spec = fixture_spec('banana-lib/BananaLib.podspec')
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox) @pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@target = AggregateTarget.new(@target_definition, config.sandbox) @target = AggregateTarget.new(@target_definition, config.sandbox)
@target.stubs(:platform).returns(:ios) @target.stubs(:platform).returns(:ios)
......
...@@ -5,6 +5,7 @@ module Pod ...@@ -5,6 +5,7 @@ module Pod
before do before do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@pod_target = PodTarget.new([spec], [@target_definition], config.sandbox) @pod_target = PodTarget.new([spec], [@target_definition], config.sandbox)
@pod_target.stubs(:platform).returns(:ios) @pod_target.stubs(:platform).returns(:ios)
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