Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions spec/defines/group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,28 @@
end
end

context 'with template' do
let(:title) { 'rspec/%u' }

content = <<-END.gsub(/^\s+\|/, '')
|# This file is being maintained by Puppet.
|# DO NOT EDIT
|
|template rspec/%u {
|
|}
END

it do
should contain_file('/etc/cgconfig.d/rspec-%u.conf').with({
'ensure' => 'file',
'notify' => 'Service[cgconfig]',
'content' => content,
})
end
end


context 'with all parameters set to valid values' do
let(:params) do
{
Expand Down
4 changes: 4 additions & 0 deletions templates/group.conf.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# This file is being maintained by Puppet.
# DO NOT EDIT

<% unless @name.include? "%" -%>
group <%= @name %> {
<% else -%>
template <%= @name %> {
<% end -%>
<% unless @permissions.empty? -%>

perm {
Expand Down