Module: ChefSpec::API::DscResourceMatchers
- Defined in:
- lib/chefspec/api/dsc_resource.rb
Overview
Instance Method Summary collapse
-
#run_dsc_resource(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
dsc_resourceresource exists in the Chef run with the action:run.
Instance Method Details
#run_dsc_resource(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a dsc_resource resource exists in the Chef run with the action :run. Given a Chef Recipe that installs “zip” as a dsc_resource:
dsc_resource 'zip' do
resource :archive
property :ensure, 'Present'
property :path, "C:\Users\Public\Documents\example.zip"
property :destination, "C:\Users\Public\Documents\ExtractionPath"
end
To test the content rendered by a dsc_resource, see RenderFileMatchers.
The Examples section demonstrates the different ways to test a dsc_resource resource with ChefSpec.
45 46 47 |
# File 'lib/chefspec/api/dsc_resource.rb', line 45 def run_dsc_resource(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:dsc_resource, :run, resource_name) end |