module Poise::Helpers::ChefspecMatchers::ClassMethods

@!classmethods

Public Instance Methods

actions(*names) click to toggle source

Create matchers for all declared actions.

@see Resource::LWRPPolyfill.actions

Calls superclass method
# File lib/poise/helpers/chefspec_matchers.rb, line 75
def actions(*names)
  super.tap do |actions|
    actions.each do |action|
      ChefspecMatchers.create_matcher(resource_name, action)
    end if resource_name && resource_name != :resource && !names.empty?
  end
end
included(klass) click to toggle source
Calls superclass method
# File lib/poise/helpers/chefspec_matchers.rb, line 83
def included(klass)
  super
  klass.extend ClassMethods
end
provides(name, *args, &block) click to toggle source

Create a resource-level matcher for this resource.

@see Resource::ResourceName.provides

Calls superclass method
# File lib/poise/helpers/chefspec_matchers.rb, line 63
def provides(name, *args, &block)
  super(name, *args, &block)
  ChefSpec.define_matcher(name) if defined?(ChefSpec)
  # Call #actions here to grab any actions from a parent class.
  actions.each do |action|
    ChefspecMatchers.create_matcher(name, action)
  end
end