Module: ChefSpec::API::RemoteFileMatchers
- Defined in:
- lib/chefspec/api/remote_file.rb
Overview
Instance Method Summary collapse
-
#create_remote_file(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_file
resource exists in the Chef run with the action:create
. -
#create_remote_file_if_missing(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_file
resource exists in the Chef run with the action:create_if_missing
. -
#delete_remote_file(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_file
resource exists in the Chef run with the action:delete
. -
#touch_remote_file(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
remote_file
resource exists in the Chef run with the action:touch
.
Instance Method Details
#create_remote_file(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_file
resource exists in the Chef run with the action :create
. Given a Chef Recipe that creates “/tmp/config” as a remote_file
:
remote_file '/tmp/config' do
action :create
end
To test the content rendered by a remote_file
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a remote_file
resource with ChefSpec.
42 43 44 |
# File 'lib/chefspec/api/remote_file.rb', line 42 def create_remote_file(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_file, :create, resource_name) end |
#create_remote_file_if_missing(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_file
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_file
:
remote_file '/tmp/config' do
action :create_if_missing
end
To test the content rendered by a remote_file
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a remote_file
resource with ChefSpec.
82 83 84 |
# File 'lib/chefspec/api/remote_file.rb', line 82 def create_remote_file_if_missing(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_file, :create_if_missing, resource_name) end |
#delete_remote_file(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_file
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “/tmp/config” as a remote_file
:
remote_file '/tmp/config' do
action :delete
end
To test the content rendered by a remote_file
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a remote_file
resource with ChefSpec.
122 123 124 |
# File 'lib/chefspec/api/remote_file.rb', line 122 def delete_remote_file(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_file, :delete, resource_name) end |
#touch_remote_file(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a remote_file
resource exists in the Chef run with the action :touch
. Given a Chef Recipe that touches “/tmp/config” as a remote_file
:
remote_file '/tmp/config' do
action :touch
end
To test the content rendered by a remote_file
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a remote_file
resource with ChefSpec.
162 163 164 |
# File 'lib/chefspec/api/remote_file.rb', line 162 def touch_remote_file(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:remote_file, :touch, resource_name) end |