Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a second spec test for the name/path combination

  • Loading branch information...
commit 1972a9b86b1fcbcef31ad3fedbd825cf08223635 1 parent 3ac955e
@vStone vStone authored
Showing with 59 additions and 1 deletion.
  1. +59 −1 spec/defines/init_spec.rb
View
60 spec/defines/init_spec.rb
@@ -3,7 +3,7 @@
describe 'concat' do
basedir = '/var/lib/puppet/concat'
let(:title) { '/etc/foo.bar' }
- let(:facts) { {
+ let(:facts) { {
:concat_basedir => '/var/lib/puppet/concat',
:id => 'root',
} }
@@ -54,4 +54,62 @@
end
end
+describe 'concat' do
+
+ basedir = '/var/lib/puppet/concat'
+ let(:title) { 'foobar' }
+ let(:target) { '/etc/foo.bar' }
+ let(:facts) { {
+ :concat_basedir => '/var/lib/puppet/concat',
+ :id => 'root',
+ } }
+ let :pre_condition do
+ 'include concat::setup'
+ end
+
+ directories = [
+ "#{basedir}/foobar",
+ "#{basedir}/foobar/fragments",
+ ]
+
+ directories.each do |dirs|
+ it do
+ should contain_file(dirs).with({
+ 'ensure' => 'directory',
+ 'backup' => 'puppet',
+ 'group' => 0,
+ 'mode' => '0644',
+ 'owner' => 'root',
+ })
+ end
+ end
+
+ files = [
+ "foobar",
+ "#{basedir}/foobar/fragments.concat",
+ ]
+
+ files.each do |file|
+ it do
+ should contain_file(file).with({
+ 'ensure' => 'present',
+ 'backup' => 'puppet',
+ 'group' => 0,
+ 'mode' => '0644',
+ 'owner' => 'root',
+ })
+ end
+ end
+
+ it do
+ should contain_exec("concat_foobar").with_command(
+ "#{basedir}/bin/concatfragments.sh " +
+ "-o #{basedir}/foobar/fragments.concat.out " +
+ "-d #{basedir}/foobar "
+ )
+ end
+
+
+end
+
# vim:sw=2:ts=2:expandtab:textwidth=79
Please sign in to comment.
Something went wrong with that request. Please try again.