Module: ChefSpec::API::GroupMatchers
- Defined in:
- lib/chefspec/api/group.rb
Overview
Instance Method Summary collapse
-
#create_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
group
resource exists in the Chef run with the action:create
. -
#manage_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
group
resource exists in the Chef run with the action:manage
. -
#modify_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
group
resource exists in the Chef run with the action:modify
. -
#remove_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
group
resource exists in the Chef run with the action:remove
.
Instance Method Details
#create_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a group
resource exists in the Chef run with the action :create
. Given a Chef Recipe that creates “apache2” as a group
:
group 'apache2' do
action :create
end
The Examples section demonstrates the different ways to test a group
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/group.rb', line 39 def create_group(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:group, :create, resource_name) end |
#manage_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a group
resource exists in the Chef run with the action :manage
. Given a Chef Recipe that manages “apache2” as a group
:
group 'apache2' do
action :manage
end
The Examples section demonstrates the different ways to test a group
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/group.rb', line 76 def manage_group(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:group, :manage, resource_name) end |
#modify_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a group
resource exists in the Chef run with the action :modify
. Given a Chef Recipe that modifies “apache2” as a group
:
group 'apache2' do
action :modify
end
The Examples section demonstrates the different ways to test a group
resource with ChefSpec.
113 114 115 |
# File 'lib/chefspec/api/group.rb', line 113 def modify_group(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:group, :modify, resource_name) end |
#remove_group(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a group
resource exists in the Chef run with the action :remove
. Given a Chef Recipe that removes “apache2” as a group
:
group 'apache2' do
action :remove
end
The Examples section demonstrates the different ways to test a group
resource with ChefSpec.
150 151 152 |
# File 'lib/chefspec/api/group.rb', line 150 def remove_group(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:group, :remove, resource_name) end |