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| shared_examples 'setup' do |concatdir|
concatdir = '/foo' if concatdir.nil? 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 it do
should contain_file("#{concatdir}/bin/concatfragments.sh").with({ should contain_file("#{concatdir}/bin/concatfragments.sh").with({
@ -45,6 +52,7 @@ describe 'concat::setup', :type => :class do
let(:facts) do let(:facts) do
{ {
:concat_basedir => concatdir, :concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'Solaris', :osfamily => 'Solaris',
:id => 'root', :id => 'root',
} }
@ -66,6 +74,7 @@ describe 'concat::setup', :type => :class do
let(:facts) do let(:facts) do
{ {
:concat_basedir => concatdir, :concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'windows', :osfamily => 'windows',
:id => 'batman', :id => 'batman',
} }

View file

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

View file

@ -33,7 +33,15 @@ describe 'concat', :type => :define do
let(:title) { title } let(:title) { title }
let(:params) { params } 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' if p[:ensure] == 'present'
it do it do