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
ec058332
Commit
ec058332
authored
Apr 02, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Check file suffix of module_map
parent
cc80b803
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
validator.rb
lib/cocoapods/validator.rb
+8
-2
validator_spec.rb
spec/unit/validator_spec.rb
+10
-0
No files found.
lib/cocoapods/validator.rb
View file @
ec058332
...
...
@@ -419,8 +419,14 @@ module Pod
end
def
_validate_module_map
if
spec
.
module_map
&&
!
file_accessor
.
module_map
.
exist?
error
(
'module_map'
,
'Unable to find the specified module map file.'
)
if
spec
.
module_map
unless
file_accessor
.
module_map
.
exist?
error
(
'module_map'
,
'Unable to find the specified module map file.'
)
end
unless
file_accessor
.
module_map
.
extname
==
'.modulemap'
relative_path
=
file_accessor
.
module_map
.
relative_path_from
file_accessor
.
root
error
(
'module_map'
,
"Unexpected file extension for modulemap file (
#{
relative_path
}
)."
)
end
end
end
...
...
spec/unit/validator_spec.rb
View file @
ec058332
...
...
@@ -455,6 +455,16 @@ module Pod
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/Unable to find the specified module map file./
validator
.
result_type
.
should
==
:error
end
it
'checks module_map accepts only modulemaps'
do
file
=
write_podspec
(
stub_podspec
(
/.*source_files.*/
,
'"source_files": "JSONKit.*", "module_map": "JSONKit.m",'
))
validator
=
Validator
.
new
(
file
,
SourcesManager
.
master
.
map
(
&
:url
))
validator
.
stubs
(
:build_pod
)
validator
.
stubs
(
:validate_url
)
validator
.
validate
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/Unexpected file extension for modulemap file \(JSONKit\.m\)/
validator
.
result_type
.
should
==
:error
end
end
it
'validates a podspec with dependencies'
do
...
...
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