module ChefSpec

Constants

Runner

As we start to migrate back to only SoloRunner, include this alias for now.

@since 7.3

VERSION

Public Class Methods

define_matcher(resource_name) click to toggle source

Defines a new runner method on the Chef runner.

@param [Symbol] resource_name

the name of the resource to define a method

@return [self]

# File lib/chefspec.rb, line 12
def define_matcher(resource_name)
  matchers[resource_name.to_sym] = Proc.new do |identity|
    find_resource(resource_name, identity)
  end

  self
end
matchers() click to toggle source

The list of custom defined matchers.

@return [Hash<String, Proc>]

# File lib/chefspec.rb, line 39
def matchers
  @matchers ||= {}
end
root() click to toggle source

The source root of the ChefSpec gem. This is useful when requiring files that are relative to the root of the project.

@return [Pathname]

# File lib/chefspec.rb, line 27
def root
  @root ||= Pathname.new(File.expand_path("..", __dir__))
end

Private Instance Methods

define_matcher(resource_name) click to toggle source

Defines a new runner method on the Chef runner.

@param [Symbol] resource_name

the name of the resource to define a method

@return [self]

# File lib/chefspec.rb, line 12
def define_matcher(resource_name)
  matchers[resource_name.to_sym] = Proc.new do |identity|
    find_resource(resource_name, identity)
  end

  self
end
matchers() click to toggle source

The list of custom defined matchers.

@return [Hash<String, Proc>]

# File lib/chefspec.rb, line 39
def matchers
  @matchers ||= {}
end
root() click to toggle source

The source root of the ChefSpec gem. This is useful when requiring files that are relative to the root of the project.

@return [Pathname]

# File lib/chefspec.rb, line 27
def root
  @root ||= Pathname.new(File.expand_path("..", __dir__))
end