Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
afc18cc1
Unverified
Commit
afc18cc1
authored
May 26, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Init] Use target product type to determine test targets
parent
9462f9f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
Gemfile.lock
Gemfile.lock
+1
-1
init.rb
lib/cocoapods/command/init.rb
+1
-1
init_spec.rb
spec/functional/command/init_spec.rb
+23
-3
No files found.
Gemfile.lock
View file @
afc18cc1
...
...
@@ -24,7 +24,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision:
480e2f99e5e9315b8032854a9530aa500761e13
8
revision:
cd03f259381c2b6317e60f088adff6b6e2b01d6
8
branch: master
specs:
xcodeproj (1.0.0)
...
...
lib/cocoapods/command/init.rb
View file @
afc18cc1
...
...
@@ -63,7 +63,7 @@ module Pod
# Split out the targets into app and test targets
test_targets
,
app_targets
=
project
.
native_targets
.
sort_by
{
|
t
|
t
.
name
.
downcase
}.
partition
{
|
t
|
t
.
name
=~
/test/i
}
partition
(
&
:test_target_type?
)
app_targets
.
each
do
|
app_target
|
test_targets_for_app
=
test_targets
.
select
do
|
target
|
...
...
spec/functional/command/init_spec.rb
View file @
afc18cc1
...
...
@@ -90,8 +90,8 @@ module Pod
Dir
.
chdir
(
temporary_directory
)
do
project
=
Xcodeproj
::
Project
.
new
(
temporary_directory
+
'test.xcodeproj'
)
project
.
new_target
(
:application
,
'App'
,
:ios
)
project
.
new_target
(
:
application
,
'AppTests'
,
:ios
)
project
.
new_target
(
:
application
,
'AppFeatureTests'
,
:ios
)
project
.
new_target
(
:
unit_test_bundle
,
'AppTests'
,
:ios
)
project
.
new_target
(
:
ui_test_bundle
,
'AppFeatureTests'
,
:ios
)
project
.
new_target
(
:application
,
'Swifty App'
,
:osx
,
nil
,
nil
,
:swift
)
project
.
save
...
...
@@ -142,7 +142,7 @@ module Pod
project
=
Xcodeproj
::
Project
.
new
(
temporary_directory
+
'test.xcodeproj'
)
project
.
new_target
(
:application
,
'App'
,
:ios
)
project
.
new_target
(
:
application
,
'AppTests'
,
:ios
)
project
.
new_target
(
:
unit_test_bundle
,
'AppTests'
,
:ios
)
project
.
save
run_command
(
'init'
)
...
...
@@ -152,6 +152,26 @@ module Pod
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
Dir
.
chdir
(
temporary_directory
)
do
tmp_templates_dir
=
Pathname
.
pwd
+
'templates_dir'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment