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
89265242
Commit
89265242
authored
Apr 01, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small cleanup and use xit for a few more specs instead of commenting.
parent
cb05af48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
92 deletions
+76
-92
project.rb
lib/cocoapods/project.rb
+0
-14
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+76
-78
No files found.
lib/cocoapods/project.rb
View file @
89265242
...
...
@@ -43,19 +43,5 @@ module Pod
target
end
private
# TODO this needs to be added to each individual target
def
self
.
build_settings
(
platform
)
settings
=
{}
if
platform
.
requires_legacy_ios_archs?
settings
[
'ARCHS'
]
=
"armv6 armv7"
end
if
platform
==
:ios
&&
platform
.
deployment_target
settings
[
'IPHONEOS_DEPLOYMENT_TARGET'
]
=
platform
.
deployment_target
.
to_s
end
settings
end
end
end
spec/unit/local_pod_spec.rb
View file @
89265242
...
...
@@ -80,9 +80,7 @@ describe Pod::LocalPod do
end
end
# TODO: This is really what a LocalPod now represents
# Which probably means most of this functionality should move there
#describe "A Pod::Specification, with installed source," do
describe
"A Pod::LocalPod, with installed source,"
do
#before do
#config.project_pods_root = fixture('integration')
#podspec = fixture('spec-repos/master/SSZipArchive/0.1.0/SSZipArchive.podspec')
...
...
@@ -94,85 +92,85 @@ end
#config.project_pods_root = nil
#end
#
it "returns the list of files that the source_files pattern expand to" do
#
files = @destroot.glob('**/*.{h,c,m}')
#
files = files.map { |file| file.relative_path_from(config.project_pods_root) }
#
@spec.expanded_source_files[:ios].sort.should == files.sort
#
end
x
it
"returns the list of files that the source_files pattern expand to"
do
files
=
@destroot
.
glob
(
'**/*.{h,c,m}'
)
files
=
files
.
map
{
|
file
|
file
.
relative_path_from
(
config
.
project_pods_root
)
}
@spec
.
expanded_source_files
[
:ios
].
sort
.
should
==
files
.
sort
end
#
it "returns the list of headers" do
#
files = @destroot.glob('**/*.h')
#
files = files.map { |file| file.relative_path_from(config.project_pods_root) }
#
@spec.header_files[:ios].sort.should == files.sort
#
end
x
it
"returns the list of headers"
do
files
=
@destroot
.
glob
(
'**/*.h'
)
files
=
files
.
map
{
|
file
|
file
.
relative_path_from
(
config
.
project_pods_root
)
}
@spec
.
header_files
[
:ios
].
sort
.
should
==
files
.
sort
end
#
it "returns a hash of mappings from the pod's destroot to its header dirs, which by default is just the pod's header dir" do
#
@spec.copy_header_mappings[:ios].size.should == 1
#
@spec.copy_header_mappings[:ios][Pathname.new('SSZipArchive')].sort.should == %w{
#
SSZipArchive.h
#
minizip/crypt.h
#
minizip/ioapi.h
#
minizip/mztools.h
#
minizip/unzip.h
#
minizip/zip.h
#
}.map { |f| Pathname.new("SSZipArchive/#{f}") }.sort
#
end
x
it
"returns a hash of mappings from the pod's destroot to its header dirs, which by default is just the pod's header dir"
do
@spec
.
copy_header_mappings
[
:ios
].
size
.
should
==
1
@spec
.
copy_header_mappings
[
:ios
][
Pathname
.
new
(
'SSZipArchive'
)].
sort
.
should
==
%w{
SSZipArchive.h
minizip/crypt.h
minizip/ioapi.h
minizip/mztools.h
minizip/unzip.h
minizip/zip.h
}
.
map
{
|
f
|
Pathname
.
new
(
"SSZipArchive/
#{
f
}
"
)
}.
sort
end
#
it "allows for customization of header mappings by overriding copy_header_mapping" do
#
def @spec.copy_header_mapping(from)
#
Pathname.new('ns') + from.basename
#
end
#
@spec.copy_header_mappings[:ios].size.should == 1
#
@spec.copy_header_mappings[:ios][Pathname.new('SSZipArchive/ns')].sort.should == %w{
#
SSZipArchive.h
#
minizip/crypt.h
#
minizip/ioapi.h
#
minizip/mztools.h
#
minizip/unzip.h
#
minizip/zip.h
#
}.map { |f| Pathname.new("SSZipArchive/#{f}") }.sort
#
end
x
it
"allows for customization of header mappings by overriding copy_header_mapping"
do
def
@spec
.
copy_header_mapping
(
from
)
Pathname
.
new
(
'ns'
)
+
from
.
basename
end
@spec
.
copy_header_mappings
[
:ios
].
size
.
should
==
1
@spec
.
copy_header_mappings
[
:ios
][
Pathname
.
new
(
'SSZipArchive/ns'
)].
sort
.
should
==
%w{
SSZipArchive.h
minizip/crypt.h
minizip/ioapi.h
minizip/mztools.h
minizip/unzip.h
minizip/zip.h
}
.
map
{
|
f
|
Pathname
.
new
(
"SSZipArchive/
#{
f
}
"
)
}.
sort
end
#
it "returns a hash of mappings with a custom header dir prefix" do
#
@spec.header_dir = 'AnotherRoot'
#
@spec.copy_header_mappings[:ios][Pathname.new('AnotherRoot')].sort.should == %w{
#
SSZipArchive.h
#
minizip/crypt.h
#
minizip/ioapi.h
#
minizip/mztools.h
#
minizip/unzip.h
#
minizip/zip.h
#
}.map { |f| Pathname.new("SSZipArchive/#{f}") }.sort
#
end
x
it
"returns a hash of mappings with a custom header dir prefix"
do
@spec
.
header_dir
=
'AnotherRoot'
@spec
.
copy_header_mappings
[
:ios
][
Pathname
.
new
(
'AnotherRoot'
)].
sort
.
should
==
%w{
SSZipArchive.h
minizip/crypt.h
minizip/ioapi.h
minizip/mztools.h
minizip/unzip.h
minizip/zip.h
}
.
map
{
|
f
|
Pathname
.
new
(
"SSZipArchive/
#{
f
}
"
)
}.
sort
end
#
it "returns the user header search paths" do
#
def @spec.copy_header_mapping(from)
#
Pathname.new('ns') + from.basename
#
end
#
@spec.header_search_paths.should == %w{
#
"$(PODS_ROOT)/Headers/SSZipArchive"
#
"$(PODS_ROOT)/Headers/SSZipArchive/ns"
#
}
#
end
x
it
"returns the user header search paths"
do
def
@spec
.
copy_header_mapping
(
from
)
Pathname
.
new
(
'ns'
)
+
from
.
basename
end
@spec
.
header_search_paths
.
should
==
%w{
"$(PODS_ROOT)/Headers/SSZipArchive"
"$(PODS_ROOT)/Headers/SSZipArchive/ns"
}
end
#
it "returns the user header search paths with a custom header dir prefix" do
#
@spec.header_dir = 'AnotherRoot'
#
def @spec.copy_header_mapping(from)
#
Pathname.new('ns') + from.basename
#
end
#
@spec.header_search_paths.should == %w{
#
"$(PODS_ROOT)/Headers/AnotherRoot"
#
"$(PODS_ROOT)/Headers/AnotherRoot/ns"
#
}
#
end
x
it
"returns the user header search paths with a custom header dir prefix"
do
@spec
.
header_dir
=
'AnotherRoot'
def
@spec
.
copy_header_mapping
(
from
)
Pathname
.
new
(
'ns'
)
+
from
.
basename
end
@spec
.
header_search_paths
.
should
==
%w{
"$(PODS_ROOT)/Headers/AnotherRoot"
"$(PODS_ROOT)/Headers/AnotherRoot/ns"
}
end
#
it "returns the list of files that the resources pattern expand to" do
#
@spec.expanded_resources.should == {}
#
@spec.resource = 'LICEN*'
#
@spec.expanded_resources[:ios].map(&:to_s).should == %w{ SSZipArchive/LICENSE }
#
@spec.expanded_resources[:osx].map(&:to_s).should == %w{ SSZipArchive/LICENSE }
#
@spec.resources = 'LICEN*', 'Readme.*'
#
@spec.expanded_resources[:ios].map(&:to_s).should == %w{ SSZipArchive/LICENSE SSZipArchive/Readme.markdown }
#
@spec.expanded_resources[:osx].map(&:to_s).should == %w{ SSZipArchive/LICENSE SSZipArchive/Readme.markdown }
#
end
#
end
x
it
"returns the list of files that the resources pattern expand to"
do
@spec
.
expanded_resources
.
should
==
{}
@spec
.
resource
=
'LICEN*'
@spec
.
expanded_resources
[
:ios
].
map
(
&
:to_s
).
should
==
%w{ SSZipArchive/LICENSE }
@spec
.
expanded_resources
[
:osx
].
map
(
&
:to_s
).
should
==
%w{ SSZipArchive/LICENSE }
@spec
.
resources
=
'LICEN*'
,
'Readme.*'
@spec
.
expanded_resources
[
:ios
].
map
(
&
:to_s
).
should
==
%w{ SSZipArchive/LICENSE SSZipArchive/Readme.markdown }
@spec
.
expanded_resources
[
:osx
].
map
(
&
:to_s
).
should
==
%w{ SSZipArchive/LICENSE SSZipArchive/Readme.markdown }
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