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
0f4bb97a
Unverified
Commit
0f4bb97a
authored
May 05, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Validate that resource bundles contain resources
parent
14f7ec3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
validator.rb
lib/cocoapods/validator.rb
+7
-0
validator_spec.rb
spec/unit/validator_spec.rb
+17
-0
No files found.
lib/cocoapods/validator.rb
View file @
0f4bb97a
...
...
@@ -556,6 +556,13 @@ module Pod
end
end
def
_validate_resource_bundles
file_accessor
.
resource_bundles
.
each
do
|
bundle
,
resource_paths
|
next
unless
resource_paths
.
empty?
error
(
'file patterns'
,
"The `resource_bundles` pattern for `
#{
bundle
}
` did not match any file."
)
end
end
# Ensures that a list of header files only contains header files.
#
def
_validate_header_files
(
attr_name
)
...
...
spec/unit/validator_spec.rb
View file @
0f4bb97a
...
...
@@ -642,6 +642,23 @@ module Pod
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/Unexpected file extension for modulemap file \(JSONKit\.m\)/
validator
.
result_type
.
should
==
:error
end
it
'checks resource bundles have resources'
do
file
=
write_podspec
(
stub_podspec
(
/.*source_files.*/
,
<<-
JSON
))
"source_files": "JSONKit.*",
"resource_bundles": {
"bundle1": ["CHANGELOG.md", "*.md"],
"bundle2": "foo.bar*"
},
JSON
validator
=
Validator
.
new
(
file
,
config
.
sources_manager
.
master
.
map
(
&
:url
))
validator
.
stubs
(
:build_pod
)
validator
.
stubs
(
:validate_url
)
validator
.
validate
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
include
'The `resource_bundles` pattern for `bundle2` did not match any file'
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