class ChefSpec::SoloRunner

def find_resource(type, name, action = nil)

Returns:
  • (Chef::Resource, nil) -

Parameters:
  • action (Symbol) --
  • name (String, Regexp) --
  • type (Symbol) --

Other tags:
    Example: Find a template at `/etc/foo` -
def find_resource(type, name, action = nil)
  resource_collection.all_resources.reverse_each.find do |resource|
    resource.declared_type == type.to_sym && (name === resource.name || name === resource.identity) && (action.nil? || resource.performed_action?(action))
  end
end