Skip to content

Commit

Permalink
Strict variables test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Haskel committed Oct 8, 2014
1 parent 1c35784 commit 0138787
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 12 deletions.
23 changes: 16 additions & 7 deletions spec/unit/classes/concat_setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
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({
Expand Down Expand Up @@ -44,9 +51,10 @@
concatdir = '/foo'
let(:facts) do
{
:concat_basedir => concatdir,
:osfamily => 'Solaris',
:id => 'root',
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'Solaris',
:id => 'root',
}
end

Expand All @@ -65,9 +73,10 @@
concatdir = '/foo'
let(:facts) do
{
:concat_basedir => concatdir,
:osfamily => 'windows',
:id => 'batman',
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'windows',
:id => 'batman',
}
end

Expand Down
33 changes: 29 additions & 4 deletions spec/unit/defines/concat_fragment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@
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]}': }"
Expand Down Expand Up @@ -162,7 +169,13 @@

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',
Expand All @@ -178,7 +191,13 @@

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',
Expand All @@ -194,7 +213,13 @@

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',
Expand Down
10 changes: 9 additions & 1 deletion spec/unit/defines/concat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@

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
Expand Down

0 comments on commit 0138787

Please sign in to comment.