module-concat/spec/unit/classes/concat_setup_spec.rb

37 lines
810 B
Ruby
Raw Normal View History

2013-10-23 16:44:06 +02:00
require 'spec_helper'
describe 'concat::setup', :type => :class do
shared_examples 'setup' do |concatdir|
concatdir = '/foo' if concatdir.nil?
let(:facts) {{ :concat_basedir => concatdir }}
2013-10-23 16:44:06 +02:00
it do
should contain_file("#{concatdir}/bin/concatfragments.sh").with({
:mode => '0755',
:source => 'puppet:///modules/concat/concatfragments.sh',
:backup => false,
2013-10-23 16:44:06 +02:00
})
end
[concatdir, "#{concatdir}/bin"].each do |file|
it do
should contain_file(file).with({
:ensure => 'directory',
:mode => '0755',
:backup => false,
2013-10-23 16:44:06 +02:00
})
end
end
end
context 'facts' do
context 'concat_basedir =>' do
context '/foo' do
it_behaves_like 'setup', '/foo'
2013-10-23 16:44:06 +02:00
end
end
end # facts
end