def add_from_catalog(catalog, test_module)
catalog.to_a.each do |resource|
next if @filters.include?(resource.to_s)
if resource.type == 'Class'
module_name = resource.title.split('::').first.downcase
next if module_name != test_module
elsif resource.file
if Puppet.version.to_f >= 4.0
paths = [
(Pathname.new(Puppet[:environmentpath]) + 'fixtures' + test_module + 'manifests').to_s,
(Pathname.new(Puppet[:environmentpath]) + 'fixtures' + 'manifests' + 'site.pp').to_s
]
else
paths = Puppet[:modulepath].split(File::PATH_SEPARATOR).map do |dir|
(Pathname.new(dir) + test_module + 'manifests').to_s
end
paths << Puppet[:manifest]
end
next unless paths.any? { |path| resource.file.include?(path) }
end
add(resource)
end
end