Module: ChefSpec::API::RemoteDirectoryMatchers
- Defined in:
- lib/chefspec/api/remote_directory.rb
Overview
Instance Method Summary collapse
-
#create_remote_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_directory
resource exists in the Chef run with the action:create
. -
#create_remote_directory_if_missing(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_directory
resource exists in the Chef run with the action:create_if_missing
. -
#delete_remote_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_directory
resource exists in the Chef run with the action:delete
.
Instance Method Details
#create_remote_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_directory
resource exists in the Chef run with the action :create
. Given a Chef Recipe that creates “/tmp” as a remote_directory
:
remote_directory '/tmp' do
action :create
end
The Examples section demonstrates the different ways to test a remote_directory
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/remote_directory.rb', line 39 def create_remote_directory(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_directory, :create, resource_name) end |
#create_remote_directory_if_missing(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_directory
resource exists in the Chef run with the action :create_if_missing
. Given a Chef Recipe that creates “/tmp/config” if missing as a remote_directory
:
remote_directory '/tmp/config' do
action :create_if_missing
end
To test the content rendered by a remote_directory
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a remote_directory
resource with ChefSpec.
79 80 81 |
# File 'lib/chefspec/api/remote_directory.rb', line 79 def create_remote_directory_if_missing(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_directory, :create_if_missing, resource_name) end |
#delete_remote_directory(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_directory
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “/tmp” as a remote_directory
:
remote_directory '/tmp' do
action :delete
end
The Examples section demonstrates the different ways to test a remote_directory
resource with ChefSpec.
116 117 118 |
# File 'lib/chefspec/api/remote_directory.rb', line 116 def delete_remote_directory(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_directory, :delete, resource_name) end |