Commit 4f537725 authored by Samuel Giddins's avatar Samuel Giddins

[UserProjectIntegrator] Add a spec for deintegrating unused targets

parent b431a1cf
...@@ -14,7 +14,7 @@ module Pod ...@@ -14,7 +14,7 @@ module Pod
end end
end end
config.sandbox.project = Project.new(config.sandbox.project_path) config.sandbox.project = Project.new(config.sandbox.project_path)
Xcodeproj::Project.new(config.sandbox.project_path).save config.sandbox.project.save
@target = AggregateTarget.new(@podfile.target_definitions['Pods'], config.sandbox) @target = AggregateTarget.new(@podfile.target_definitions['Pods'], config.sandbox)
@target.client_root = sample_project_path.dirname @target.client_root = sample_project_path.dirname
@target.user_project = Xcodeproj::Project.open(@sample_project_path) @target.user_project = Xcodeproj::Project.open(@sample_project_path)
...@@ -52,6 +52,19 @@ module Pod ...@@ -52,6 +52,19 @@ module Pod
UI.warnings.should.include?('The Podfile does not contain any dependencies') UI.warnings.should.include?('The Podfile does not contain any dependencies')
end end
it 'deintegrates targets that are not associated with the podfile' do
additional_project = Xcodeproj::Project.new('Project.xcodeproj')
Deintegrator.any_instance.expects(:deintegrate_target).with additional_project.new_target(:application, 'Other App', :ios)
user_project = @target.user_project
user_project.native_targets.each do |target|
next if target.name == 'SampleProject'
Deintegrator.any_instance.expects(:deintegrate_target).with(target)
end
@integrator.stubs(:user_projects).returns([additional_project, user_project])
@integrator.send(:integrate_user_targets)
end
describe '#warn_about_xcconfig_overrides' do describe '#warn_about_xcconfig_overrides' do
shared 'warn_about_xcconfig_overrides' do shared 'warn_about_xcconfig_overrides' do
target_config = stub(:name => 'Release', :build_settings => @user_target_build_settings) target_config = stub(:name => 'Release', :build_settings => @user_target_build_settings)
......
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