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
0cb9089c
Commit
0cb9089c
authored
Sep 08, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Spec] fixture_pod_target accept an array of target definitions
parent
c1334d75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
spec_helper.rb
spec/spec_helper.rb
+4
-4
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+1
-1
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+1
-1
No files found.
spec/spec_helper.rb
View file @
0cb9089c
...
@@ -119,11 +119,11 @@ def fixture_target_definition(name = 'Pods', platform = Pod::Platform.ios)
...
@@ -119,11 +119,11 @@ def fixture_target_definition(name = 'Pods', platform = Pod::Platform.ios)
Pod
::
Podfile
::
TargetDefinition
.
new
(
name
,
Pod
::
Podfile
.
new
,
'name'
=>
name
,
'platform'
=>
platform
)
Pod
::
Podfile
::
TargetDefinition
.
new
(
name
,
Pod
::
Podfile
.
new
,
'name'
=>
name
,
'platform'
=>
platform
)
end
end
def
fixture_pod_target
(
spec_or_name
,
target_definition
=
nil
)
def
fixture_pod_target
(
spec_or_name
,
target_definition
s
=
[]
)
spec
=
spec_or_name
.
is_a?
(
Pod
::
Specification
)
?
spec_or_name
:
fixture_spec
(
spec_or_name
)
spec
=
spec_or_name
.
is_a?
(
Pod
::
Specification
)
?
spec_or_name
:
fixture_spec
(
spec_or_name
)
target_definition
||=
fixture_target_definition
target_definition
s
<<
fixture_target_definition
if
target_definitions
.
empty?
target_definition
.
store_pod
(
spec
.
name
)
target_definition
s
.
each
{
|
td
|
td
.
store_pod
(
spec
.
name
)
}
Pod
::
PodTarget
.
new
([
spec
],
[
target_definition
]
,
config
.
sandbox
).
tap
do
|
pod_target
|
Pod
::
PodTarget
.
new
([
spec
],
target_definitions
,
config
.
sandbox
).
tap
do
|
pod_target
|
pod_target
.
file_accessors
<<
fixture_file_accessor
(
spec
,
pod_target
.
platform
)
pod_target
.
file_accessors
<<
fixture_file_accessor
(
spec
,
pod_target
.
platform
)
consumer
=
spec
.
consumer
(
pod_target
.
platform
)
consumer
=
spec
.
consumer
(
pod_target
.
platform
)
pod_target
.
spec_consumers
<<
consumer
pod_target
.
spec_consumers
<<
consumer
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
0cb9089c
...
@@ -275,7 +275,7 @@ module Pod
...
@@ -275,7 +275,7 @@ module Pod
before
do
before
do
@project
.
add_pod_group
(
'snake'
,
fixture
(
'snake'
))
@project
.
add_pod_group
(
'snake'
,
fixture
(
'snake'
))
@pod_target
=
fixture_pod_target
(
'snake/snake.podspec'
,
@target_definition
)
@pod_target
=
fixture_pod_target
(
'snake/snake.podspec'
,
[
@target_definition
]
)
@pod_target
.
user_build_configurations
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
}
@pod_target
.
user_build_configurations
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
}
@pod_target
.
stubs
(
:requires_frameworks?
=>
true
)
@pod_target
.
stubs
(
:requires_frameworks?
=>
true
)
group
=
@project
.
group_for_spec
(
'snake'
)
group
=
@project
.
group_for_spec
(
'snake'
)
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
0cb9089c
...
@@ -198,7 +198,7 @@ module Pod
...
@@ -198,7 +198,7 @@ module Pod
describe
'With frameworks'
do
describe
'With frameworks'
do
before
do
before
do
@pod_target
=
fixture_pod_target
(
'orange-framework/OrangeFramework.podspec'
,
fixture_target_definition
(
'iOS Example'
)
)
@pod_target
=
fixture_pod_target
(
'orange-framework/OrangeFramework.podspec'
,
[
fixture_target_definition
(
'iOS Example'
)]
)
@target
=
AggregateTarget
.
new
(
@pod_target
.
target_definitions
.
first
,
config
.
sandbox
)
@target
=
AggregateTarget
.
new
(
@pod_target
.
target_definitions
.
first
,
config
.
sandbox
)
@target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@target
.
pod_targets
=
[
@pod_target
]
@target
.
pod_targets
=
[
@pod_target
]
...
...
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