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
19e1ceb3
Commit
19e1ceb3
authored
Aug 06, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specs] fix syntax.
parent
d44e0feb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
31 deletions
+27
-31
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+27
-31
No files found.
spec/unit/local_pod_spec.rb
View file @
19e1ceb3
...
@@ -10,28 +10,26 @@ describe Pod::LocalPod do
...
@@ -10,28 +10,26 @@ describe Pod::LocalPod do
@pod
=
Pod
::
LocalPod
.
new
(
@spec
,
@sandbox
,
Pod
::
Platform
.
new
(
:ios
))
@pod
=
Pod
::
LocalPod
.
new
(
@spec
,
@sandbox
,
Pod
::
Platform
.
new
(
:ios
))
copy_fixture_to_pod
(
'banana-lib'
,
@pod
)
copy_fixture_to_pod
(
'banana-lib'
,
@pod
)
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
.
build_headers
.
root
+
"BananaLib/Banana.h"
expected_header_path
=
@sandbox
.
build_headers
.
root
+
"BananaLib/Banana.h"
expected_header_path
.
should
.
be
.
symlink
expected_header_path
.
should
.
be
.
symlink
File
.
read
(
expected_header_path
).
should
==
(
@sandbox
.
root
+
@pod
.
header_files
[
0
]).
read
File
.
read
(
expected_header_path
).
should
==
(
@sandbox
.
root
+
@pod
.
header_files
[
0
]).
read
end
end
it
"can add it's source files to an Xcode project target"
do
it
"can add it's source files to an Xcode project target"
do
target
=
mock
(
'target'
)
target
=
mock
(
'target'
)
target
.
expects
(
:add_source_file
).
with
(
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
anything
,
anything
)
target
.
expects
(
:add_source_file
).
with
(
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
anything
,
anything
)
@pod
.
add_to_target
(
target
)
@pod
.
add_to_target
(
target
)
end
end
it
"can add it's source files to a target with any specially configured compiler flags"
do
it
"can add it's source files to a target with any specially configured compiler flags"
do
@pod
.
specification
.
compiler_flags
=
'-d some_flag'
@pod
.
specification
.
compiler_flags
=
'-d some_flag'
target
=
mock
(
'target'
)
target
=
mock
(
'target'
)
target
.
expects
(
:add_source_file
).
with
(
anything
,
anything
,
"-d some_flag"
)
target
.
expects
(
:add_source_file
).
with
(
anything
,
anything
,
"-d some_flag"
)
@pod
.
add_to_target
(
target
)
@pod
.
add_to_target
(
target
)
end
end
end
it
'returns the Pod root directory path'
do
it
'returns the Pod root directory path'
do
@pod
.
root
.
should
==
@sandbox
.
root
+
'BananaLib'
@pod
.
root
.
should
==
@sandbox
.
root
+
'BananaLib'
...
@@ -72,6 +70,16 @@ end
...
@@ -72,6 +70,16 @@ end
@pod
.
relative_header_files
.
should
==
[
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
)]
@pod
.
relative_header_files
.
should
==
[
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
)]
end
end
xit
"returns the user header search paths"
do
def
@spec
.
copy_header_mapping
(
from
)
Pathname
.
new
(
'ns'
)
+
from
.
basename
end
@spec
.
build_headers
.
search_paths
.
should
==
%w{
"$(PODS_ROOT)/Headers/SSZipArchive"
"$(PODS_ROOT)/Headers/SSZipArchive/ns"
}
end
it
'returns a list of header files by specification'
do
it
'returns a list of header files by specification'
do
files
=
@pod
.
header_files_by_spec
[
@pod
.
specifications
.
first
].
sort
files
=
@pod
.
header_files_by_spec
[
@pod
.
specifications
.
first
].
sort
files
.
should
==
[
@pod
.
root
+
"Classes/Banana.h"
]
files
.
should
==
[
@pod
.
root
+
"Classes/Banana.h"
]
...
@@ -116,21 +124,10 @@ end
...
@@ -116,21 +124,10 @@ end
@pod
.
platform
.
should
==
:ios
@pod
.
platform
.
should
==
:ios
end
end
@spec
.
build_headers
.
search_paths
.
should
==
%w{
"$(PODS_ROOT)/Headers/SSZipArchive"
"$(PODS_ROOT)/Headers/SSZipArchive/ns"
}
end
it
"raises if the files are accessed before creating the pod dir"
do
it
"raises if the files are accessed before creating the pod dir"
do
@pod
.
implode
@pod
.
implode
lambda
{
@pod
.
source_files
}.
should
.
raise
Pod
::
Informative
lambda
{
@pod
.
source_files
}.
should
.
raise
Pod
::
Informative
end
end
@spec
.
build_headers
.
search_paths
.
should
==
%w{
"$(PODS_ROOT)/Headers/AnotherRoot"
"$(PODS_ROOT)/Headers/AnotherRoot/ns"
}
end
end
describe
"with installed source and multiple subspecs"
do
describe
"with installed source and multiple subspecs"
do
...
@@ -259,7 +256,6 @@ end
...
@@ -259,7 +256,6 @@ end
assert_array_equals
(
expected
,
computed
)
assert_array_equals
(
expected
,
computed
)
end
end
it
"resolved the header files"
do
it
"resolved the header files"
do
expected
=
%w[
expected
=
%w[
Chameleon/UIKit/Classes/UIKit.h
Chameleon/UIKit/Classes/UIKit.h
...
...
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