Module: ChefSpec::API::EnvMatchers
- Defined in:
- lib/chefspec/api/env.rb
Overview
Instance Method Summary collapse
-
#create_env(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
env
resource exists in the Chef run with the action:create
. -
#delete_env(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
env
resource exists in the Chef run with the action:delete
. -
#modify_env(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
env
resource exists in the Chef run with the action:modify
.
Instance Method Details
#create_env(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an env
resource exists in the Chef run with the action :create
. Given a Chef Recipe that creates “HOME” as an env
:
env 'HOME' do
action :create
end
The Examples section demonstrates the different ways to test an env
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/env.rb', line 39 def create_env(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:env, :create, resource_name) end |
#delete_env(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an env
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “HOME” as an env
:
env 'HOME' do
action :delete
end
The Examples section demonstrates the different ways to test an env
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/env.rb', line 76 def delete_env(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:env, :delete, resource_name) end |
#modify_env(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an env
resource exists in the Chef run with the action :modify
. Given a Chef Recipe that modifies “HOME” as an env
:
env 'HOME' do
action :modify
end
The Examples section demonstrates the different ways to test an env
resource with ChefSpec.
113 114 115 |
# File 'lib/chefspec/api/env.rb', line 113 def modify_env(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:env, :modify, resource_name) end |