summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vansteenkiste <jan@vstone.eu>2012-08-30 10:10:23 +0200
committerJan Vansteenkiste <jan@vstone.eu>2012-08-30 10:10:23 +0200
commit1972a9b86b1fcbcef31ad3fedbd825cf08223635 (patch)
tree490c06cb9543f05851096490651222e7d31f94cd
parent3ac955e05dce5fbff4aedaf3e023f25db5cd9afb (diff)
downloadpuppet-concat-1972a9b86b1fcbcef31ad3fedbd825cf08223635.tar.gz
puppet-concat-1972a9b86b1fcbcef31ad3fedbd825cf08223635.tar.bz2
Add a second spec test for the name/path combination
-rw-r--r--spec/defines/init_spec.rb60
1 files changed, 59 insertions, 1 deletions
diff --git a/spec/defines/init_spec.rb b/spec/defines/init_spec.rb
index 34fb24b..172929a 100644
--- a/spec/defines/init_spec.rb
+++ b/spec/defines/init_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
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 @@ describe 'concat' do
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