Class: ChefSpec::Matchers::IncludeRecipeMatcher
- Inherits:
-
Object
- Object
- ChefSpec::Matchers::IncludeRecipeMatcher
- Defined in:
- lib/chefspec/matchers/include_recipe_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(recipe_name) ⇒ IncludeRecipeMatcher
constructor
A new instance of IncludeRecipeMatcher.
- #matches?(runner) ⇒ Boolean
Constructor Details
#initialize(recipe_name) ⇒ IncludeRecipeMatcher
Returns a new instance of IncludeRecipeMatcher.
3 4 5 |
# File 'lib/chefspec/matchers/include_recipe_matcher.rb', line 3 def initialize(recipe_name) @recipe_name = with_default(recipe_name) end |
Instance Method Details
#description ⇒ Object
12 13 14 |
# File 'lib/chefspec/matchers/include_recipe_matcher.rb', line 12 def description %Q{include recipe "#{@recipe_name}"} end |
#failure_message ⇒ Object
16 17 18 |
# File 'lib/chefspec/matchers/include_recipe_matcher.rb', line 16 def %Q{expected #{loaded_recipes.inspect} to include "#{@recipe_name}"} end |
#failure_message_when_negated ⇒ Object
20 21 22 |
# File 'lib/chefspec/matchers/include_recipe_matcher.rb', line 20 def %Q{expected "#{@recipe_name}" to not be included} end |
#matches?(runner) ⇒ Boolean
7 8 9 10 |
# File 'lib/chefspec/matchers/include_recipe_matcher.rb', line 7 def matches?(runner) @runner = runner loaded_recipes.include?(@recipe_name) end |