module-concat/spec/defines/concat_fragment_spec.rb
Joshua Hoblitt cdb6d6b007 remove undocumented requirement to include concat::setup in manifest
Unless the class `concat::setup` has been manually included into the
manifest before using the `concat` / `concat::fragment` defined types,
the puppet master will generate this warning while compiling the catalog.

    Tue Oct 15 14:05:06 -0700 2013 Scope(Concat[/etc/exports]) (warning):
    Could not look up qualified variable 'concat::setup::root_group'; class
    concat::setup has not been evaluated

The need to `include concat::setup` directly into the manifest has never
been part of the documented API.
2013-10-17 15:07:57 -07:00

37 lines
922 B
Ruby

require 'spec_helper'
describe 'concat::fragment', :type => :defne do
let(:title) { 'motd_header' }
let(:facts) do
{
:concat_basedir => '/var/lib/puppet/concat',
:id => 'root',
}
end
let :pre_condition do
"concat{ '/etc/motd': }"
end
context 'target => /etc/motd' do
let(:params) {{ :target => '/etc/motd' }}
it do
should contain_class('concat::setup')
should contain_concat('/etc/motd')
should contain_concat__fragment('motd_header').with({
:target => '/etc/motd',
})
should contain_file('/var/lib/puppet/concat/_etc_motd/fragments/10_motd_header' ).with({
:ensure => 'present',
:mode => '0644',
:owner => 'root',
:group => 0,
:source => nil,
:content => nil,
:backup => 'puppet',
:alias => 'concat_fragment_motd_header',
})
end
end
end