Module: ChefSpec::API::DoNothingMatchers

Defined in:
lib/chefspec/api/do_nothing.rb

Overview

Since:

  • 3.4.0

Instance Method Summary collapse

Instance Method Details

#do_nothingChefSpec::Matchers::DoNothingMatcher

Assert that a resource in the Chef run does not perform any actions. Given a resource with action :nothing:

package 'apache2' do
  action :nothing
end

The Examples section demonstrates the different ways to test that no actions were performed on a resource in a Chef run.

Examples:

Assert the package does not perform any actions

Since:

  • 3.4.0


20
21
22
# File 'lib/chefspec/api/do_nothing.rb', line 20

def do_nothing
  ChefSpec::Matchers::DoNothingMatcher.new
end