Merge pull request #237 from mhaskel/strict_vars

Strict variables test updates
This commit is contained in:
Hunter Haugen 2014-10-08 15:18:08 -07:00
commit 644fb1b6dc
3 changed files with 54 additions and 12 deletions

View file

@ -5,7 +5,14 @@ describe 'concat::setup', :type => :class do
shared_examples 'setup' do |concatdir|
concatdir = '/foo' if concatdir.nil?
let(:facts) {{ :concat_basedir => concatdir }}
let(:facts) do
{
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'Debian',
:id => 'root',
}
end
it do
should contain_file("#{concatdir}/bin/concatfragments.sh").with({
@ -44,9 +51,10 @@ describe 'concat::setup', :type => :class do
concatdir = '/foo'
let(:facts) do
{
:concat_basedir => concatdir,
:osfamily => 'Solaris',
:id => 'root',
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'Solaris',
:id => 'root',
}
end
@ -65,9 +73,10 @@ describe 'concat::setup', :type => :class do
concatdir = '/foo'
let(:facts) do
{
:concat_basedir => concatdir,
:osfamily => 'windows',
:id => 'batman',
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'windows',
:id => 'batman',
}
end

View file

@ -24,7 +24,14 @@ describe 'concat::fragment', :type => :define do
end
let(:title) { title }
let(:facts) {{ :concat_basedir => concatdir, :id => id }}
let(:facts) do
{
:concat_basedir => concatdir,
:id => id,
:osfamily => 'Debian',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
let(:params) { params }
let(:pre_condition) do
"concat{ '#{p[:target]}': }"
@ -162,7 +169,13 @@ describe 'concat::fragment', :type => :define do
context 'ensure => target and source' do
let(:title) { 'motd_header' }
let(:facts) {{ :concat_basedir => '/tmp' }}
let(:facts) do
{
:concat_basedir => '/tmp',
:osfamily => 'Debian',
:id => 'root',
}
end
let(:params) do
{
:target => '/etc/motd',
@ -178,7 +191,13 @@ describe 'concat::fragment', :type => :define do
context 'ensure => target and content' do
let(:title) { 'motd_header' }
let(:facts) {{ :concat_basedir => '/tmp' }}
let(:facts) do
{
:concat_basedir => '/tmp',
:osfamily => 'Debian',
:id => 'root',
}
end
let(:params) do
{
:target => '/etc/motd',
@ -194,7 +213,13 @@ describe 'concat::fragment', :type => :define do
context 'source and content' do
let(:title) { 'motd_header' }
let(:facts) {{ :concat_basedir => '/tmp' }}
let(:facts) do
{
:concat_basedir => '/tmp',
:osfamily => 'Debian',
:id => 'root',
}
end
let(:params) do
{
:target => '/etc/motd',

View file

@ -33,7 +33,15 @@ describe 'concat', :type => :define do
let(:title) { title }
let(:params) { params }
let(:facts) {{ :concat_basedir => concatdir, :id => id }}
let(:facts) do
{
:concat_basedir => concatdir,
:id => id,
:osfamily => 'Debian',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:kernel => 'Linux',
}
end
if p[:ensure] == 'present'
it do