Commit 62c30fd7 authored by Marius Rackwitz's avatar Marius Rackwitz

[Spec PodTargetInstaller] Combine resource bundle target specs

parent e6390d93
...@@ -154,38 +154,35 @@ module Pod ...@@ -154,38 +154,35 @@ module Pod
@project.targets.first.name.should == 'BananaLib-Pods-SampleProject' @project.targets.first.name.should == 'BananaLib-Pods-SampleProject'
end end
it 'adds the resource bundle targets' do describe 'resource bundle targets' do
before do
@pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => []) @pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => [])
@installer.install! @installer.install!
bundle_target = @project.targets.find { |t| t.name == 'BananaLib-Pods-SampleProject-banana_bundle' } @bundle_target = @project.targets.find { |t| t.name == 'BananaLib-Pods-SampleProject-banana_bundle' }
bundle_target.should.be.an.instance_of Xcodeproj::Project::Object::PBXNativeTarget
bundle_target.product_reference.name.should == 'banana_bundle.bundle'
bundle_target.product_reference.path.should == 'banana_bundle.bundle'
bundle_target.platform_name.should == :ios
bundle_target.deployment_target.should == '4.3'
end end
it 'adds the build configurations to the resources bundle targets' do it 'adds the resource bundle targets' do
@pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => []) @bundle_target.should.be.an.instance_of Xcodeproj::Project::Object::PBXNativeTarget
@installer.install! @bundle_target.product_reference.name.should == 'banana_bundle.bundle'
bundle_target = @project.targets.find { |t| t.name == 'BananaLib-Pods-SampleProject-banana_bundle' } @bundle_target.product_reference.path.should == 'banana_bundle.bundle'
@bundle_target.platform_name.should == :ios
@bundle_target.deployment_target.should == '4.3'
end
it 'adds the build configurations to the resources bundle targets' do
file = config.sandbox.root + @pod_target.xcconfig_path file = config.sandbox.root + @pod_target.xcconfig_path
bundle_target.build_configurations.each do |bc| @bundle_target.build_configurations.each do |bc|
bc.base_configuration_reference.real_path.should == file bc.base_configuration_reference.real_path.should == file
end end
end end
it 'sets the correct targeted device family for the resource bundle targets' do it 'sets the correct targeted device family for the resource bundle targets' do
@pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => []) @bundle_target.build_configurations.each do |bc|
@installer.install!
bundle_target = @project.targets.find { |t| t.name == 'BananaLib-Pods-SampleProject-banana_bundle' }
bundle_target.build_configurations.each do |bc|
bc.build_settings['TARGETED_DEVICE_FAMILY'].should == '1,2' bc.build_settings['TARGETED_DEVICE_FAMILY'].should == '1,2'
end end
end end
end end
end
#--------------------------------------# #--------------------------------------#
...@@ -207,26 +204,27 @@ module Pod ...@@ -207,26 +204,27 @@ module Pod
@project.targets.first.name.should == 'BananaLib' @project.targets.first.name.should == 'BananaLib'
end end
it 'adds the resource bundle targets' do describe 'resource bundle targets' do
before do
@pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => []) @pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => [])
@installer.install! @installer.install!
bundle_target = @project.targets.find { |t| t.name == 'BananaLib-banana_bundle' } @bundle_target = @project.targets.find { |t| t.name == 'BananaLib-banana_bundle' }
bundle_target.should.be.an.instance_of Xcodeproj::Project::Object::PBXNativeTarget
bundle_target.product_reference.name.should == 'banana_bundle.bundle'
bundle_target.product_reference.path.should == 'banana_bundle.bundle'
end end
it 'adds the build configurations to the resources bundle targets' do it 'adds the resource bundle targets' do
@pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => []) @bundle_target.should.be.an.instance_of Xcodeproj::Project::Object::PBXNativeTarget
@installer.install! @bundle_target.product_reference.name.should == 'banana_bundle.bundle'
bundle_target = @project.targets.find { |t| t.name == 'BananaLib-banana_bundle' } @bundle_target.product_reference.path.should == 'banana_bundle.bundle'
end
it 'adds the build configurations to the resources bundle targets' do
file = config.sandbox.root + @pod_target.xcconfig_path file = config.sandbox.root + @pod_target.xcconfig_path
bundle_target.build_configurations.each do |bc| @bundle_target.build_configurations.each do |bc|
bc.base_configuration_reference.real_path.should == file bc.base_configuration_reference.real_path.should == file
end end
end end
end 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