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
1ac725d2
Commit
1ac725d2
authored
Oct 31, 2014
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] More tests for activating subspecs for requested platform.
See #2757.
parent
dc8b5338
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
17 deletions
+45
-17
resolver_spec.rb
spec/unit/resolver_spec.rb
+45
-17
No files found.
spec/unit/resolver_spec.rb
View file @
1ac725d2
...
@@ -175,23 +175,6 @@ module Pod
...
@@ -175,23 +175,6 @@ module Pod
e
.
message
.
should
.
match
(
/platform .* not compatible/
)
e
.
message
.
should
.
match
(
/platform .* not compatible/
)
end
end
it
'excludes dependencies from `Specification#subspec_dependencies` '
\
'with incompatible platforms without raising'
do
@podfile
=
Podfile
.
new
do
platform
:osx
,
'10.10'
pod
'AFNetworking'
,
'2.4.1'
# Has an 'AFNetworking/UIKit' iOS-only default subspec
end
resolver
=
Resolver
.
new
(
config
.
sandbox
,
@podfile
,
empty_graph
,
SourcesManager
.
all
)
resolver
.
resolve
.
values
.
flatten
.
map
(
&
:to_s
).
sort
.
should
==
[
"AFNetworking (2.4.1)"
,
"AFNetworking/NSURLConnection (2.4.1)"
,
"AFNetworking/NSURLSession (2.4.1)"
,
"AFNetworking/Reachability (2.4.1)"
,
"AFNetworking/Security (2.4.1)"
,
"AFNetworking/Serialization (2.4.1)"
,
]
end
it
'raises if unable to find a specification'
do
it
'raises if unable to find a specification'
do
Specification
.
any_instance
.
stubs
(
:all_dependencies
).
returns
([
Dependency
.
new
(
'Windows'
)])
Specification
.
any_instance
.
stubs
(
:all_dependencies
).
returns
([
Dependency
.
new
(
'Windows'
)])
message
=
should
.
raise
Informative
do
message
=
should
.
raise
Informative
do
...
@@ -379,6 +362,51 @@ module Pod
...
@@ -379,6 +362,51 @@ module Pod
UI
.
warnings
.
should
.
match
/multiple specifications/
UI
.
warnings
.
should
.
match
/multiple specifications/
end
end
describe
'concerning dependencies from `Specification#subspec_dependencies`'
do
def
resolve
Resolver
.
new
(
config
.
sandbox
,
@podfile
,
empty_graph
,
SourcesManager
.
all
).
resolve
end
# AFNetworking Has an 'AFNetworking/UIKit' iOS-only default subspec
requirement
=
[
'AFNetworking'
,
'2.4.1'
]
ios_subspec
=
'AFNetworking/UIKit (2.4.1)'
it
'excludes those for another platform'
do
@podfile
=
Podfile
.
new
do
platform
:osx
,
'10.10'
pod
(
*
requirement
)
end
resolve
.
values
.
flatten
.
map
(
&
:to_s
).
should
.
not
.
include
ios_subspec
end
it
'includes those for the requested platform'
do
@podfile
=
Podfile
.
new
do
platform
:ios
,
'7'
pod
(
*
requirement
)
end
resolve
.
values
.
flatten
.
map
(
&
:to_s
).
should
.
include
ios_subspec
end
it
'includes those in the target for the requested platform only'
do
@podfile
=
Podfile
.
new
do
target
'iOS'
do
platform
:ios
,
'7'
pod
(
*
requirement
)
end
target
'OSX'
do
platform
:osx
,
'10.10'
pod
(
*
requirement
)
end
end
resolved
=
resolve
ios_target
=
resolved
.
keys
.
find
{
|
td
|
td
.
label
==
'Pods-iOS'
}
osx_target
=
resolved
.
keys
.
find
{
|
td
|
td
.
label
==
'Pods-OSX'
}
resolved
[
ios_target
].
map
(
&
:to_s
).
should
.
include
ios_subspec
resolved
[
osx_target
].
map
(
&
:to_s
).
should
.
not
.
include
ios_subspec
end
end
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
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