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
9511cc44
Commit
9511cc44
authored
May 23, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specs] Placeholder for LocalPod and TODOs.
parent
2c462d18
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
17 deletions
+77
-17
integration_spec.rb
spec/integration_spec.rb
+2
-0
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+73
-15
resolver_spec.rb
spec/unit/resolver_spec.rb
+2
-2
No files found.
spec/integration_spec.rb
View file @
9511cc44
...
@@ -234,6 +234,7 @@ else
...
@@ -234,6 +234,7 @@ else
end
end
# TODO add a simple source file which uses the compiled lib to check that it really really works
# TODO add a simple source file which uses the compiled lib to check that it really really works
# TODO update for specification refactor
it
"activates required pods and create a working static library xcode project"
do
it
"activates required pods and create a working static library xcode project"
do
podfile
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
self
.
platform
platform
self
.
platform
platform
...
@@ -279,6 +280,7 @@ else
...
@@ -279,6 +280,7 @@ else
end
end
if
platform
==
:ios
if
platform
==
:ios
# TODO: update for Specification Refactor
it
"does not activate pods that are only part of other pods"
do
it
"does not activate pods that are only part of other pods"
do
spec
=
Pod
::
Podfile
.
new
do
spec
=
Pod
::
Podfile
.
new
do
self
.
platform
platform
self
.
platform
platform
...
...
spec/unit/local_pod_spec.rb
View file @
9511cc44
...
@@ -50,15 +50,6 @@ describe Pod::LocalPod do
...
@@ -50,15 +50,6 @@ describe Pod::LocalPod do
@pod
.
header_files
.
should
==
[
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
)]
@pod
.
header_files
.
should
==
[
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
)]
end
end
xit
'can clean up after itself'
do
@pod
.
clean
@pod
.
clean_paths
.
tap
do
|
paths
|
paths
.
each
do
|
path
|
path
.
should
.
not
.
exist
end
end
end
it
"can link it's headers into the sandbox"
do
it
"can link it's headers into the sandbox"
do
@pod
.
link_headers
@pod
.
link_headers
expected_header_path
=
@sandbox
.
headers_root
+
"BananaLib/Banana.h"
expected_header_path
=
@sandbox
.
headers_root
+
"BananaLib/Banana.h"
...
@@ -79,6 +70,10 @@ describe Pod::LocalPod do
...
@@ -79,6 +70,10 @@ describe Pod::LocalPod do
target
.
expects
(
:add_source_file
).
twice
.
with
(
anything
,
anything
,
"-d some_flag"
)
target
.
expects
(
:add_source_file
).
twice
.
with
(
anything
,
anything
,
"-d some_flag"
)
@pod
.
add_to_target
(
target
)
@pod
.
add_to_target
(
target
)
end
end
it
"returns the platform"
do
@pod
.
platform
.
should
==
:ios
end
end
end
describe
"with installed source,"
do
describe
"with installed source,"
do
...
@@ -172,18 +167,81 @@ describe Pod::LocalPod do
...
@@ -172,18 +167,81 @@ describe Pod::LocalPod do
end
end
end
end
describe
"with installed source from multiple subspecs"
do
describe
"regarding multiple subspecs"
do
xit
"returns the source files of the activated specs"
xit
"returns the resources of the activated specs"
before
do
# specification with only some subspecs activated
# to check that only the needed files are being activated
# A fixture is needed.
#
# specification = Pod::Spec.new do |s|
# ...
# s.xcconfig = ...
# s.compiler_flags = ...
# s.subspec 's1' do |s1|
# s1.xcconfig = ...
# s1.compiler_flags = ...
# s1.ns.source_files = 's1.{h,m}'
# end
#
# s.subspec 's2' do |s2|
# s2.ns.source_files = 's2.{h,m}'
# end
#
# Add only s1 to the localPod
# s1 = specification.subspec_by_name(s1)
# @pod = Pod::LocalPod.new(s1, @sandbox, Pod::Platform.new(:ios))
# @pod.add_specification(specification)
end
xit
"can provide the source files of all the subspecs"
do
xit
"returns the subspecs"
do
pod
.
all_specs_source_files
.
should
==
%w[]
@pod
.
subspecs
.
map
{
|
s
|
name
}.
should
==
%w[ s1 ]
end
xit
"resolve the source files"
do
@pod
.
source_files
.
should
==
%w[ s1.h s1.m ]
end
xit
"resolve the resources"
do
end
xit
"resolve the clean paths"
do
@pod
.
clean_paths
.
should
==
%w[ s2.h s2.m ]
end
xit
"resolves the used files"
do
@pod
.
used_files
.
should
==
%w[ s1.h s1.m README.md ]
end
xit
"resolved the header files"
do
@pod
.
header_files
.
should
==
%w[ s1.h ]
end
xit
"resolves the header files of every subspec"
do
@pod
.
all_specs_public_header_files
.
should
==
%w[ s1.h s2.h ]
end
xit
"merges the xcconfigs"
do
end
xit
"adds each file to a target with the compiler flags of its specification"
do
# @pod.add_to_target(target)
end
end
xit
"can provide the source files of all the subspecs"
do
xit
"can provide the source files of all the subspecs"
do
sources
=
@pod
.
all_specs_source_files
.
map
{
|
p
|
p
.
relative_path_from
(
@sandbox
.
root
).
to_s
}
sources
=
@pod
.
all_specs_source_files
.
map
{
|
p
|
p
.
relative_path_from
(
@sandbox
.
root
).
to_s
}
sources
.
should
==
%w[
BananaLib/Classes/Banana.h BananaLib/Classes/Banana
.m ]
sources
.
should
==
%w[
s1.h s1.m s2.h s2
.m ]
end
end
xit
'can clean the unused files'
do
# copy fixture to another folder
@pod
.
clean
@pod
.
clean_paths
.
tap
do
|
paths
|
paths
.
each
do
|
path
|
path
.
should
.
not
.
exist
end
end
end
end
end
end
end
spec/unit/resolver_spec.rb
View file @
9511cc44
...
@@ -12,7 +12,7 @@ describe "Pod::Resolver" do
...
@@ -12,7 +12,7 @@ describe "Pod::Resolver" do
@resolver
=
Pod
::
Resolver
.
new
(
@podfile
,
stub
(
'sandbox'
))
@resolver
=
Pod
::
Resolver
.
new
(
@podfile
,
stub
(
'sandbox'
))
end
end
x
it
"holds the context state, such as cached specification sets"
do
it
"holds the context state, such as cached specification sets"
do
@resolver
.
resolve
@resolver
.
resolve
@resolver
.
cached_sets
.
values
.
sort_by
(
&
:name
).
should
==
[
@resolver
.
cached_sets
.
values
.
sort_by
(
&
:name
).
should
==
[
Pod
::
Spec
::
Set
.
new
(
config
.
repos_dir
+
'master/A2DynamicDelegate'
),
Pod
::
Spec
::
Set
.
new
(
config
.
repos_dir
+
'master/A2DynamicDelegate'
),
...
@@ -20,7 +20,7 @@ describe "Pod::Resolver" do
...
@@ -20,7 +20,7 @@ describe "Pod::Resolver" do
].
sort_by
(
&
:name
)
].
sort_by
(
&
:name
)
end
end
x
it
"returns all specs needed for the dependency"
do
it
"returns all specs needed for the dependency"
do
specs
=
@resolver
.
resolve
.
values
.
flatten
specs
=
@resolver
.
resolve
.
values
.
flatten
specs
.
map
(
&
:class
).
uniq
.
should
==
[
Pod
::
Specification
]
specs
.
map
(
&
:class
).
uniq
.
should
==
[
Pod
::
Specification
]
specs
.
map
(
&
:name
).
sort
.
should
==
%w{ A2DynamicDelegate BlocksKit }
specs
.
map
(
&
:name
).
sort
.
should
==
%w{ A2DynamicDelegate BlocksKit }
...
...
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