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
bb81dffc
Commit
bb81dffc
authored
Mar 06, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for PodfileDependencyCache
parent
2849fbd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
podfile_dependency_cache.rb
lib/cocoapods/installer/analyzer/podfile_dependency_cache.rb
+3
-1
podfile_dependency_cache_spec.rb
.../unit/installer/analyzer/podfile_dependency_cache_spec.rb
+46
-0
No files found.
lib/cocoapods/installer/analyzer/podfile_dependency_cache.rb
View file @
bb81dffc
...
...
@@ -3,6 +3,7 @@ module Pod
class
Analyzer
# Caches podfile & target definition dependencies, so they do not need to be re-computed
# from the internal hash on each access
#
class
PodfileDependencyCache
# @return [Array<Pod::Dependency>]
# All the dependencies in the podfile
...
...
@@ -17,7 +18,8 @@ module Pod
# Returns the dependencies for the given target definition
#
def
target_definition_dependencies
(
target_definition
)
@dependencies_by_target_definition
[
target_definition
]
||
raise
(
"dependencies for
#{
target_definition
.
inspect
}
do not exist in the cache"
)
@dependencies_by_target_definition
[
target_definition
]
||
raise
(
ArgumentError
,
"dependencies for
#{
target_definition
.
inspect
}
do not exist in the cache"
)
end
# Returns a list of all of the target definitions in the Podfile
...
...
spec/unit/installer/analyzer/podfile_dependency_cache_spec.rb
0 → 100644
View file @
bb81dffc
require
File
.
expand_path
(
'../../../../spec_helper'
,
__FILE__
)
module
Pod
class
Installer
class
Analyzer
describe
PodfileDependencyCache
do
describe
'.from_podfile'
do
it
'returns a warmed cache'
do
podfile
=
Podfile
.
new
do
pod
'A'
target
'T1'
do
pod
'B'
target
'T1T'
do
inherit!
:search_paths
pod
'C'
end
end
target
'T2'
do
pod
'B'
target
'T2T'
do
inherit!
:none
pod
'D'
end
end
end
cache
=
PodfileDependencyCache
.
from_podfile
(
podfile
)
cache
.
podfile_dependencies
.
should
==
podfile
.
dependencies
target_definitions
=
podfile
.
target_definition_list
cache
.
target_definition_list
.
should
==
target_definitions
podfile
.
target_definition_list
.
each
do
|
td
|
cache
.
target_definition_dependencies
(
td
).
should
==
td
.
dependencies
end
lambda
{
cache
.
target_definition_dependencies
(
nil
)
}.
should
.
raise
(
ArgumentError
)
end
end
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