Merge pull request #106 from jhoblitt/system_test_cleanups

minor system test cleanups
This commit is contained in:
Ashley Penney 2013-11-14 09:59:11 -08:00
commit 4ff6aa5716
7 changed files with 37 additions and 30 deletions

View file

@ -56,7 +56,7 @@ describe 'basic concat test' do
end
context 'owner/group root' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file':
owner => 'root',
group => 'root',
@ -74,7 +74,7 @@ describe 'basic concat test' do
content => '2',
order => '02',
}
"
EOS
it_behaves_like 'successfully_applied', pp

View file

@ -13,75 +13,75 @@ describe 'deprecation warnings' do
end
context 'concat gnu parameter' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file':
gnu => 'foo',
}
concat::fragment { 'foo':
target => '/tmp/concat/file',
}
"
EOS
w = 'The $gnu parameter to concat is deprecated and has no effect'
it_behaves_like 'has_warning', pp, w
end
context 'concat::fragment mode parameter' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file': }
concat::fragment { 'foo':
target => '/tmp/concat/file',
mode => 'bar',
}
"
EOS
w = 'The $mode parameter to concat::fragment is deprecated and has no effect'
it_behaves_like 'has_warning', pp, w
end
context 'concat::fragment owner parameter' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file': }
concat::fragment { 'foo':
target => '/tmp/concat/file',
owner => 'bar',
}
"
EOS
w = 'The $owner parameter to concat::fragment is deprecated and has no effect'
it_behaves_like 'has_warning', pp, w
end
context 'concat::fragment group parameter' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file': }
concat::fragment { 'foo':
target => '/tmp/concat/file',
group => 'bar',
}
"
EOS
w = 'The $group parameter to concat::fragment is deprecated and has no effect'
it_behaves_like 'has_warning', pp, w
end
context 'concat::fragment backup parameter' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file': }
concat::fragment { 'foo':
target => '/tmp/concat/file',
backup => 'bar',
}
"
EOS
w = 'The $backup parameter to concat::fragment is deprecated and has no effect'
it_behaves_like 'has_warning', pp, w
end
context 'include concat::setup' do
pp="
pp = <<-EOS
include concat::setup
"
EOS
w = 'concat::setup is deprecated as a public API of the concat module and should no longer be directly included in the manifest.'
it_behaves_like 'has_warning', pp, w

View file

@ -2,14 +2,14 @@ require 'spec_helper_system'
describe 'basic concat test' do
context 'should run successfully' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file':
owner => root,
group => root,
mode => '0644',
force => true,
}
"
EOS
context puppet_apply(pp) do
its(:stderr) { should be_empty }

View file

@ -2,14 +2,15 @@ require 'spec_helper_system'
describe 'concat::fragment source lists ' do
context 'should create files containing first match only.' do
file1_contents="file1 contents"
file2_contents="file2 contents"
let(:file1_contents) { 'file1 contents' }
let(:file2_contents) { 'file2 contents' }
before(:all) do
shell("/bin/echo '#{file1_contents}' > /tmp/concat/file1")
shell("/bin/echo '#{file2_contents}' > /tmp/concat/file2")
end
pp="
pp = <<-EOS
concat { '/tmp/concat/result_file1':
owner => root,
group => root,
@ -41,7 +42,8 @@ describe 'concat::fragment source lists ' do
source => [ '/tmp/concat/file1', '/tmp/concat/file2' ],
order => '01',
}
"
EOS
context puppet_apply(pp) do
its(:stderr) { should be_empty }
its(:exit_code) { should_not == 1 }
@ -70,7 +72,8 @@ describe 'concat::fragment source lists ' do
before(:all) do
shell("/bin/rm /tmp/concat/fail_no_source /tmp/concat/nofilehere /tmp/concat/nothereeither")
end
pp="
pp = <<-EOS
concat { '/tmp/concat/fail_no_source':
owner => root,
group => root,
@ -82,7 +85,8 @@ describe 'concat::fragment source lists ' do
source => [ '/tmp/concat/nofilehere', '/tmp/concat/nothereeither' ],
order => '01',
}
"
EOS
context puppet_apply(pp) do
its(:exit_code) { should_not be_zero }
its(:exit_code) { should_not == 1 }

View file

@ -2,9 +2,12 @@ require 'spec_helper_system'
describe 'file should not replace' do
shell('echo "file exists" >> /tmp/concat/file')
before(:all) do
shell('echo "file exists" > /tmp/concat/file')
end
context 'should fail' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file':
owner => root,
group => root,
@ -23,7 +26,7 @@ describe 'file should not replace' do
content => '2',
order => '02',
}
"
EOS
context puppet_apply(pp) do
its(:stderr) { should be_empty }

View file

@ -1,7 +1,7 @@
require 'spec_helper_system'
describe 'symbolic name' do
pp="
pp = <<-EOS
concat { 'not_abs_path':
path => '/tmp/concat/file',
}
@ -17,7 +17,7 @@ describe 'symbolic name' do
content => '2',
order => '02',
}
"
EOS
context puppet_apply(pp) do
its(:stderr) { should be_empty }

View file

@ -2,7 +2,7 @@ require 'spec_helper_system'
describe 'basic concat test' do
context 'should run successfully' do
pp="
pp = <<-EOS
concat { '/tmp/concat/file':
owner => root,
group => root,
@ -21,7 +21,7 @@ describe 'basic concat test' do
content => '2',
order => '02',
}
"
EOS
context puppet_apply(pp) do
its(:stderr) { should be_empty }