Commit 4fec429f authored by Marius Rackwitz's avatar Marius Rackwitz

Merge branch 'master' into 1-0-stable

parents 34efacd8 0407b396
...@@ -43,6 +43,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -43,6 +43,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[William Entriken](https://github.com/fulldecent) [William Entriken](https://github.com/fulldecent)
[CocoaPods/pod-template#69](https://github.com/CocoaPods/pod-template/issues/69) [CocoaPods/pod-template#69](https://github.com/CocoaPods/pod-template/issues/69)
* Use target product types to determine whether a target is a test target when
running `pod init`.
[Samuel Giddins](https://github.com/segiddins)
[#5378](https://github.com/CocoaPods/CocoaPods/issues/5378)
## 1.0.0 (2016-05-10) ## 1.0.0 (2016-05-10)
......
...@@ -24,7 +24,7 @@ GIT ...@@ -24,7 +24,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Xcodeproj.git remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 480e2f99e5e9315b8032854a9530aa500761e138 revision: cd03f259381c2b6317e60f088adff6b6e2b01d68
branch: master branch: master
specs: specs:
xcodeproj (1.0.0) xcodeproj (1.0.0)
......
...@@ -63,7 +63,7 @@ module Pod ...@@ -63,7 +63,7 @@ module Pod
# Split out the targets into app and test targets # Split out the targets into app and test targets
test_targets, app_targets = project.native_targets. test_targets, app_targets = project.native_targets.
sort_by { |t| t.name.downcase }. sort_by { |t| t.name.downcase }.
partition { |t| t.name =~ /test/i } partition(&:test_target_type?)
app_targets.each do |app_target| app_targets.each do |app_target|
test_targets_for_app = test_targets.select do |target| test_targets_for_app = test_targets.select do |target|
......
...@@ -90,8 +90,8 @@ module Pod ...@@ -90,8 +90,8 @@ module Pod
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj') project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, 'App', :ios) project.new_target(:application, 'App', :ios)
project.new_target(:application, 'AppTests', :ios) project.new_target(:unit_test_bundle, 'AppTests', :ios)
project.new_target(:application, 'AppFeatureTests', :ios) project.new_target(:ui_test_bundle, 'AppFeatureTests', :ios)
project.new_target(:application, 'Swifty App', :osx, nil, nil, :swift) project.new_target(:application, 'Swifty App', :osx, nil, nil, :swift)
project.save project.save
...@@ -142,7 +142,7 @@ module Pod ...@@ -142,7 +142,7 @@ module Pod
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj') project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, 'App', :ios) project.new_target(:application, 'App', :ios)
project.new_target(:application, 'AppTests', :ios) project.new_target(:unit_test_bundle, 'AppTests', :ios)
project.save project.save
run_command('init') run_command('init')
...@@ -152,6 +152,26 @@ module Pod ...@@ -152,6 +152,26 @@ module Pod
end end
end end
it 'does not treat non-test targets as test targets' do
Dir.chdir(temporary_directory) do
tmp_templates_dir = Pathname.pwd + 'templates_dir'
tmp_templates_dir.mkpath
config.stubs(:templates_dir).returns(tmp_templates_dir)
open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" }
project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, 'Test', :ios)
project.new_target(:application, 'Test Test Test', :ios)
project.save
run_command('init')
config.podfile.target_definitions['Test'].dependencies.should.be.empty
config.podfile.target_definitions['Test Test Test'].dependencies.should.be.empty
end
end
it 'does not include default test pods if there are no test targets' do it 'does not include default test pods if there are no test targets' do
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
tmp_templates_dir = Pathname.pwd + 'templates_dir' tmp_templates_dir = Pathname.pwd + 'templates_dir'
......
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