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
018cb7f4
Commit
018cb7f4
authored
Nov 03, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make specs green.
parent
3bbee447
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
76 deletions
+11
-76
bridge_support_generator_spec.rb
spec/unit/bridge_support_generator_spec.rb
+2
-2
installer_spec.rb
spec/unit/installer_spec.rb
+5
-70
podfile_spec.rb
spec/unit/podfile_spec.rb
+3
-3
config_spec.rb
spec/unit/xcode/config_spec.rb
+1
-1
No files found.
spec/unit/bridge_support_generator_spec.rb
View file @
018cb7f4
...
@@ -7,8 +7,8 @@ describe "Pod::BridgeSupportGenerator" do
...
@@ -7,8 +7,8 @@ describe "Pod::BridgeSupportGenerator" do
def
generator
.
gen_bridge_metadata
(
command
)
def
generator
.
gen_bridge_metadata
(
command
)
@command
=
command
@command
=
command
end
end
generator
.
create_in
(
Pathname
.
new
(
"/path/to/Pods
"
))
generator
.
save_as
(
Pathname
.
new
(
"/path/to/Pods.bridgesupport
"
))
generator
.
instance_variable_get
(
:@command
).
should
==
generator
.
instance_variable_get
(
:@command
).
should
==
%{-c "-I '/some/dir' -I '/some/other/dir'" -o '/path/to/Pods
/Pods
.bridgesupport' '#{headers.join("' '")}'}
%{-c "-I '/some/dir' -I '/some/other/dir'" -o '/path/to/Pods.bridgesupport' '#{headers.join("' '")}'}
end
end
end
end
spec/unit/installer_spec.rb
View file @
018cb7f4
...
@@ -3,7 +3,7 @@ require File.expand_path('../../spec_helper', __FILE__)
...
@@ -3,7 +3,7 @@ require File.expand_path('../../spec_helper', __FILE__)
describe
"Pod::Installer"
do
describe
"Pod::Installer"
do
describe
", by default,"
do
describe
", by default,"
do
before
do
before
do
@xcconfig
=
Pod
::
Installer
.
new
(
Pod
::
Spec
.
new
)
.
xcconfig
.
to_hash
@xcconfig
=
Pod
::
Installer
.
new
(
Pod
::
Podfile
.
new
{
platform
:ios
}).
targets
.
first
.
xcconfig
.
to_hash
end
end
it
"sets the header search paths where installed Pod headers can be found"
do
it
"sets the header search paths where installed Pod headers can be found"
do
...
@@ -33,9 +33,9 @@ describe "Pod::Installer" do
...
@@ -33,9 +33,9 @@ describe "Pod::Installer" do
end
end
it
"generates a BridgeSupport metadata file from all the pod headers"
do
it
"generates a BridgeSupport metadata file from all the pod headers"
do
spec
=
Pod
::
Spec
.
new
do
|
s
|
spec
=
Pod
::
Podfile
.
new
do
s
.
platform
=
:osx
platform
:osx
s
.
dependency
'ASIHTTPRequest'
dependency
'ASIHTTPRequest'
end
end
expected
=
[]
expected
=
[]
installer
=
Pod
::
Installer
.
new
(
spec
)
installer
=
Pod
::
Installer
.
new
(
spec
)
...
@@ -44,71 +44,6 @@ describe "Pod::Installer" do
...
@@ -44,71 +44,6 @@ describe "Pod::Installer" do
expected
<<
config
.
project_pods_root
+
header
expected
<<
config
.
project_pods_root
+
header
end
end
end
end
installer
.
bridge_support_generator
.
headers
.
should
==
expected
installer
.
targets
.
first
.
bridge_support_generator
.
headers
.
should
==
expected
end
it
"adds all source files that should be included in the library to the xcode project"
do
[
[
'ASIHTTPRequest'
,
[
'Classes'
],
{
'ASIHTTPRequest'
=>
"Classes/*.{h,m}"
,
'Reachability'
=>
"External/Reachability/*.{h,m}"
},
{
"USER_HEADER_SEARCH_PATHS"
=>
'"$(BUILT_PRODUCTS_DIR)/Pods" '
\
'"$(BUILT_PRODUCTS_DIR)/Pods/ASIHTTPRequest" '
\
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"'
,
"ALWAYS_SEARCH_USER_PATHS"
=>
"YES"
,
"OTHER_LDFLAGS"
=>
"-ObjC -all_load "
\
"-framework SystemConfiguration -framework MobileCoreServices "
\
"-framework CFNetwork -lz.1"
}
],
[
'Reachability'
,
[
"External/Reachability/*.h"
,
"External/Reachability/*.m"
],
{
'Reachability'
=>
"External/Reachability/*.{h,m}"
,
},
{
"USER_HEADER_SEARCH_PATHS"
=>
'"$(BUILT_PRODUCTS_DIR)/Pods" '
\
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"'
,
"ALWAYS_SEARCH_USER_PATHS"
=>
"YES"
,
"OTHER_LDFLAGS"
=>
"-ObjC -all_load"
}
],
[
'ASIWebPageRequest'
,
[
'**/ASIWebPageRequest.*'
],
{
'ASIHTTPRequest'
=>
"Classes/*.{h,m}"
,
'ASIWebPageRequest'
=>
"Classes/ASIWebPageRequest/*.{h,m}"
,
'Reachability'
=>
"External/Reachability/*.{h,m}"
},
{
"USER_HEADER_SEARCH_PATHS"
=>
'"$(BUILT_PRODUCTS_DIR)/Pods" '
\
'"$(BUILT_PRODUCTS_DIR)/Pods/ASIHTTPRequest" '
\
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"'
,
"ALWAYS_SEARCH_USER_PATHS"
=>
"YES"
,
"HEADER_SEARCH_PATHS"
=>
"$(SDKROOT)/usr/include/libxml2"
,
"OTHER_LDFLAGS"
=>
"-ObjC -all_load "
\
"-lxml2.2.7.3 -framework SystemConfiguration "
\
"-framework MobileCoreServices -framework CFNetwork -lz.1"
}
],
].
each
do
|
name
,
patterns
,
expected_patterns
,
xcconfig
|
Pod
::
Source
.
reset!
Pod
::
Spec
::
Set
.
reset!
installer
=
Pod
::
Installer
.
new
(
Pod
::
Spec
.
new
do
|
s
|
s
.
platform
=
:ios
s
.
dependency
(
name
)
s
.
source_files
=
*
patterns
end
)
installer
.
generate_project
expected_patterns
.
each
do
|
name
,
pattern
|
pattern
=
config
.
project_pods_root
+
'ASIHTTPRequest'
+
pattern
expected
=
pattern
.
glob
.
map
do
|
file
|
file
.
relative_path_from
(
config
.
project_pods_root
)
end
installer
.
xcodeproj
.
source_files
[
name
].
size
.
should
==
expected
.
size
installer
.
xcodeproj
.
source_files
[
name
].
sort
.
should
==
expected
.
sort
end
installer
.
xcconfig
.
to_hash
.
should
==
xcconfig
end
end
end
end
end
spec/unit/podfile_spec.rb
View file @
018cb7f4
...
@@ -44,13 +44,13 @@ describe "Pod::Podfile" do
...
@@ -44,13 +44,13 @@ describe "Pod::Podfile" do
it
"adds dependencies outside of any explicit target block to the default target"
do
it
"adds dependencies outside of any explicit target block to the default target"
do
target
=
@podfile
.
targets
[
:default
]
target
=
@podfile
.
targets
[
:default
]
target
.
lib_name
.
should
==
'
lib
Pods'
target
.
lib_name
.
should
==
'Pods'
target
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'ASIHTTPRequest'
)]
target
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'ASIHTTPRequest'
)]
end
end
it
"adds dependencies of the outer target to non-exclusive targets"
do
it
"adds dependencies of the outer target to non-exclusive targets"
do
target
=
@podfile
.
targets
[
:debug
]
target
=
@podfile
.
targets
[
:debug
]
target
.
lib_name
.
should
==
'
lib
Pods-debug'
target
.
lib_name
.
should
==
'Pods-debug'
target
.
dependencies
.
sort_by
(
&
:name
).
should
==
[
target
.
dependencies
.
sort_by
(
&
:name
).
should
==
[
Pod
::
Dependency
.
new
(
'ASIHTTPRequest'
),
Pod
::
Dependency
.
new
(
'ASIHTTPRequest'
),
Pod
::
Dependency
.
new
(
'SSZipArchive'
)
Pod
::
Dependency
.
new
(
'SSZipArchive'
)
...
@@ -59,7 +59,7 @@ describe "Pod::Podfile" do
...
@@ -59,7 +59,7 @@ describe "Pod::Podfile" do
it
"does not add dependencies of the outer target to exclusive targets"
do
it
"does not add dependencies of the outer target to exclusive targets"
do
target
=
@podfile
.
targets
[
:test
]
target
=
@podfile
.
targets
[
:test
]
target
.
lib_name
.
should
==
'
lib
Pods-test'
target
.
lib_name
.
should
==
'Pods-test'
target
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'JSONKit'
)]
target
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'JSONKit'
)]
end
end
end
end
...
...
spec/unit/xcode/config_spec.rb
View file @
018cb7f4
...
@@ -25,7 +25,7 @@ describe "Pod::Xcode::Config" do
...
@@ -25,7 +25,7 @@ describe "Pod::Xcode::Config" do
it
"creates the config file"
do
it
"creates the config file"
do
@config
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
'/some/path'
)
@config
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
'/some/path'
)
@config
.
merge!
(
'OTHER_LD_FLAGS'
=>
'-l xml2.2.7.3'
)
@config
.
merge!
(
'OTHER_LD_FLAGS'
=>
'-l xml2.2.7.3'
)
@config
.
create_in
(
temporary_directory
)
@config
.
save_as
(
temporary_directory
+
'Pods.xcconfig'
)
(
temporary_directory
+
'Pods.xcconfig'
).
read
.
split
(
"
\n
"
).
sort
.
should
==
[
(
temporary_directory
+
'Pods.xcconfig'
).
read
.
split
(
"
\n
"
).
sort
.
should
==
[
"OTHER_LD_FLAGS = -framework Foundation -l xml2.2.7.3"
,
"OTHER_LD_FLAGS = -framework Foundation -l xml2.2.7.3"
,
"HEADER_SEARCH_PATHS = /some/path"
"HEADER_SEARCH_PATHS = /some/path"
...
...
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