Module: ChefSpec::API::DirectoryMatchers
- Defined in:
- lib/chefspec/api/directory.rb
Overview
Instance Method Summary collapse
-
#create_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
directoryresource exists in the Chef run with the action:create. -
#delete_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
directoryresource exists in the Chef run with the action:delete.
Instance Method Details
#create_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a directory resource exists in the Chef run with the action :create. Given a Chef Recipe that creates “/tmp” as a directory:
directory '/tmp' do
action :create
end
The Examples section demonstrates the different ways to test a directory resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/directory.rb', line 39 def create_directory(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:directory, :create, resource_name) end |
#delete_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a directory resource exists in the Chef run with the action :delete. Given a Chef Recipe that deletes “/tmp” as a directory:
directory '/tmp' do
action :delete
end
The Examples section demonstrates the different ways to test a directory resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/directory.rb', line 76 def delete_directory(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:directory, :delete, resource_name) end |