module ChefSpec::API::Core::ClassMethods

def automatic_attributes

Returns:
  • (Chef::Node::VividMash) -
def automatic_attributes
  @chefspec_automatic_attributes ||= Chef::Node::VividMash.new
end

def chefspec_options

Returns:
  • (Chef::Node::VividMash) -
def chefspec_options
  @chefspec_options ||= Chef::Node::VividMash.new
end

def default_attributes

Returns:
  • (Chef::Node::VividMash) -
def default_attributes
  @chefspec_default_attributes ||= Chef::Node::VividMash.new
end

def included(klass)

Other tags:
    Api: - private
def included(klass)
  super
  # Inject classmethods into the group.
  klass.extend(ClassMethods)
  # If the describe block is aimed at string or resource/provider class
  # then set the default subject to be the Chef run.
  if klass.described_class.nil? || klass.described_class.is_a?(Class) && (klass.described_class < Chef::Resource || klass.described_class < Chef::Provider)
    klass.subject { chef_run }
  end
end

def normal_attributes

Returns:
  • (Chef::Node::VividMash) -
def normal_attributes
  @chefspec_normal_attributes ||= Chef::Node::VividMash.new
end

def override_attributes

Returns:
  • (Chef::Node::VividMash) -
def override_attributes
  @chefspec_override_attributes ||= Chef::Node::VividMash.new
end

def platform(name, version = nil)

Returns:
  • (void) -

Parameters:
  • version (String, nil) -- Platform version to set.
  • name (String) -- Platform name to set.
def platform(name, version = nil)
  let(:chefspec_platform) { name }
  let(:chefspec_platform_version) { version }
end

def recipe(&block)

Returns:
  • (void) -

Parameters:
  • block (Proc) -- A block of Chef recipe code.
def recipe(&block)
  let(:chef_run) do
    chef_runner.converge_block(&block)
  end
end

def step_into(*resources)

Returns:
  • (Array) -
def step_into(*resources)
  @chefspec_step_into ||= []
  @chefspec_step_into |= resources.flatten.map(&:to_s)
end