[Validator] Validate that resource bundles contain resources

parent 14f7ec3c
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment