Module: ChefSpec::API::ExecuteMatchers
- Defined in:
- lib/chefspec/api/execute.rb
Overview
Instance Method Summary collapse
-
#run_execute(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
executeresource exists in the Chef run with the action:run.
Instance Method Details
#run_execute(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an execute resource exists in the Chef run with the action :run. Given a Chef Recipe that runs “echo ”hello“” as an execute:
execute 'echo "hello"' do
action :run
end
The Examples section demonstrates the different ways to test an execute resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/execute.rb', line 39 def run_execute(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:execute, :run, resource_name) end |