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
72647e80
Commit
72647e80
authored
Oct 27, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodspecFinder] Add some basic specs
parent
1f99b4ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
podspec_finder_spec.rb
spec/unit/sandbox/podspec_finder_spec.rb
+48
-0
No files found.
spec/unit/sandbox/podspec_finder_spec.rb
0 → 100644
View file @
72647e80
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Sandbox
::
PodspecFinder
do
before
do
@root
=
Pathname
(
Dir
.
mktmpdir
)
@finder
=
Sandbox
::
PodspecFinder
.
new
(
@root
)
end
after
do
@root
.
rmtree
end
it
'returns an empty hash when no podspecs are found'
do
@finder
.
podspecs
.
should
.
be
.
empty
end
it
"warns when a found podspec can't be parsed"
do
@root
.
+
(
'RestKit.podspec.json'
).
open
(
'w'
)
{
|
f
|
f
<<
'{]'
}
@finder
.
podspecs
.
should
.
be
.
empty
UI
.
warnings
.
should
.
include
"Unable to load a podspec from `RestKit.podspec.json`, skipping:
\n\n
"
end
it
'ignores podspecs not in the root'
do
path
=
@root
+
'Dir/RestKit.podspec.json'
path
.
parent
.
mkpath
path
.
open
(
'w'
)
{
|
f
|
f
<<
'{"name":"RestKit"}'
}
@finder
.
podspecs
.
should
.
be
.
empty
end
it
'groups found podspecs by name'
do
@root
.
+
(
'Realm.podspec.json'
).
open
(
'w'
)
{
|
f
|
f
<<
'{"name":"Realm"}'
}
@root
.
+
(
'RealmSwift.podspec'
).
open
(
'w'
)
{
|
f
|
f
<<
'Pod::Specification.new { |s| s.name = "RealmSwift" }'
}
@finder
.
podspecs
.
should
==
{
'Realm'
=>
Pod
::
Specification
.
new
{
|
s
|
s
.
name
=
'Realm'
},
'RealmSwift'
=>
Pod
::
Specification
.
new
{
|
s
|
s
.
name
=
'RealmSwift'
},
}
end
it
'caches the podspecs'
do
@finder
.
podspecs
Pathname
.
expects
(
:glob
).
never
@finder
.
podspecs
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