Module: ChefSpec::API::RegistryKeyMatchers
- Defined in:
- lib/chefspec/api/registry_key.rb
Overview
Instance Method Summary collapse
-
#create_registry_key(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
registry_key
resource exists in the Chef run with the action:create
. -
#create_registry_key_if_missing(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
registry_key
resource exists in the Chef run with the action:create_if_missing
. -
#delete_key_registry_key(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
registry_key
resource exists in the Chef run with the action:delete_key
. -
#delete_registry_key(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
registry_key
resource exists in the Chef run with the action:delete
.
Instance Method Details
#create_registry_key(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a registry_key
resource exists in the Chef run with the action :create
. Given a Chef Recipe that creates “HKEY_LOCAL_MACHINE\SOFTWARE” as a registry_key
:
registry_key 'HKEY_LOCAL_MACHINE\\SOFTWARE' do
action :create
end
To test the content rendered by a registry_key
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a registry_key
resource with ChefSpec.
42 43 44 |
# File 'lib/chefspec/api/registry_key.rb', line 42 def create_registry_key(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:registry_key, :create, resource_name) end |
#create_registry_key_if_missing(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a registry_key
resource exists in the Chef run with the action :create_if_missing
. Given a Chef Recipe that creates “HKEY_LOCAL_MACHINE\SOFTWARE” if missing as a registry_key
:
registry_key 'HKEY_LOCAL_MACHINE\\SOFTWARE' do
action :create_if_missing
end
To test the content rendered by a registry_key
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a registry_key
resource with ChefSpec.
82 83 84 |
# File 'lib/chefspec/api/registry_key.rb', line 82 def create_registry_key_if_missing(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:registry_key, :create_if_missing, resource_name) end |
#delete_key_registry_key(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a registry_key
resource exists in the Chef run with the action :delete_key
. Given a Chef Recipe that delete_keys “HKEY_LOCAL_MACHINE\SOFTWARE” as a registry_key
:
registry_key 'HKEY_LOCAL_MACHINE\\SOFTWARE' do
action :delete_key
end
To test the content rendered by a registry_key
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a registry_key
resource with ChefSpec.
162 163 164 |
# File 'lib/chefspec/api/registry_key.rb', line 162 def delete_key_registry_key(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:registry_key, :delete_key, resource_name) end |
#delete_registry_key(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a registry_key
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “HKEY_LOCAL_MACHINE\SOFTWARE” as a registry_key
:
registry_key 'HKEY_LOCAL_MACHINE\\SOFTWARE' do
action :delete
end
To test the content rendered by a registry_key
, see ChefSpec::API::RenderFileMatchers.
The Examples section demonstrates the different ways to test a registry_key
resource with ChefSpec.
122 123 124 |
# File 'lib/chefspec/api/registry_key.rb', line 122 def delete_registry_key(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:registry_key, :delete, resource_name) end |