Module: ChefSpec::API::DscScriptMatchers
- Defined in:
- lib/chefspec/api/dsc_script.rb
Overview
Instance Method Summary collapse
-
#run_dsc_script(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
dsc_scriptresource exists in the Chef run with the action:run.
Instance Method Details
#run_dsc_script(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a dsc_script resource exists in the Chef run with the action :run. Given a Chef Recipe that runs “something” using dsc_script:
dsc_script 'something' do
code " something\n EOH\n action :run\nend\n"
The Examples section demonstrates the different ways to test a dsc_script resource with ChefSpec.
33 34 35 |
# File 'lib/chefspec/api/dsc_script.rb', line 33 def run_dsc_script(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:dsc_script, :run, resource_name) end |