class ChefSpec::Matchers::IncludeRecipeMatcher

def description

def description
  %Q{include recipe "#{@recipe_name}"}
end

def failure_message

def failure_message
  %Q{expected #{loaded_recipes.inspect} to include "#{@recipe_name}"}
end

def failure_message_when_negated

def failure_message_when_negated
  %Q{expected "#{@recipe_name}" to not be included}
end

def initialize(recipe_name)

def initialize(recipe_name)
  @recipe_name = with_default(recipe_name)
end

def loaded_recipes

Returns:
  • (Array) -
def loaded_recipes
  @runner.run_context.loaded_recipes.map { |name| with_default(name) }
end

def matches?(runner)

def matches?(runner)
  @runner = runner
  loaded_recipes.include?(@recipe_name)
end

def with_default(name)

Returns:
  • (String) -

Parameters:
  • name (String) --
def with_default(name)
  name.include?('::') ? name : "#{name}::default"
end