Commit e963cfcc authored by Fabio Pelosin's avatar Fabio Pelosin

[PodSourceInstaller] Handle nil values in file patterns

parent 40db4498
......@@ -269,6 +269,7 @@ module Pod
# specifications (according to their platform) of this Pod.
#
def used_files
files = [
file_accessors.map(&:source_files),
file_accessors.map(&:resources).map(&:values).flatten,
......@@ -277,7 +278,8 @@ module Pod
file_accessors.map(&:readme),
file_accessors.map(&:license),
]
files.flatten.map!{ |path| path.to_s }.uniq
files.flatten.compact.map{ |path| path.to_s }.uniq
end
#-----------------------------------------------------------------------#
......
......@@ -213,6 +213,17 @@ module Pod
]
end
it "compacts the used files as nil would be converted to the empty string" do
Sandbox::FileAccessor.any_instance.stubs(:source_files)
Sandbox::FileAccessor.any_instance.stubs(:resources).returns({})
Sandbox::FileAccessor.any_instance.stubs(:preserve_paths)
Sandbox::FileAccessor.any_instance.stubs(:prefix_header)
Sandbox::FileAccessor.any_instance.stubs(:readme)
Sandbox::FileAccessor.any_instance.stubs(:license)
paths = @installer.send(:used_files)
paths.should == []
end
end
#-------------------------------------------------------------------------#
......
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