Merge pull request #632 from jfryman/update-upstream-tests
spec: update upstream_spec for puppetlabs-concat 2
This commit is contained in:
commit
c092c5a92a
1 changed files with 3 additions and 4 deletions
|
@ -27,8 +27,7 @@ describe 'nginx::resource::upstream' do
|
||||||
describe 'basic assumptions' do
|
describe 'basic assumptions' do
|
||||||
let :params do default_params end
|
let :params do default_params end
|
||||||
|
|
||||||
it { is_expected.to contain_class('concat::setup') }
|
it { is_expected.to contain_concat("/etc/nginx/conf.d/#{title}-upstream.conf") }
|
||||||
it { is_expected.to contain_file("/etc/nginx/conf.d/#{title}-upstream.conf") }
|
|
||||||
it { is_expected.to contain_concat__fragment("#{title}_upstream_header").with_content(/upstream #{title}/) }
|
it { is_expected.to contain_concat__fragment("#{title}_upstream_header").with_content(/upstream #{title}/) }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
|
@ -96,7 +95,7 @@ describe 'nginx::resource::upstream' do
|
||||||
context "when #{param[:attr]} is #{param[:value]}" do
|
context "when #{param[:attr]} is #{param[:value]}" do
|
||||||
let :params do default_params.merge({ param[:attr].to_sym => param[:value] }) end
|
let :params do default_params.merge({ param[:attr].to_sym => param[:value] }) end
|
||||||
|
|
||||||
it { is_expected.to contain_file("/etc/nginx/conf.d/#{title}-upstream.conf").with_mode('0644') }
|
it { is_expected.to contain_concat("/etc/nginx/conf.d/#{title}-upstream.conf").with_mode('0644') }
|
||||||
it { is_expected.to contain_concat__fragment("#{title}_upstream_#{param[:fragment]}") }
|
it { is_expected.to contain_concat__fragment("#{title}_upstream_#{param[:fragment]}") }
|
||||||
it param[:title] do
|
it param[:title] do
|
||||||
lines = catalogue.resource('concat::fragment', "#{title}_upstream_#{param[:fragment]}").send(:parameters)[:content].split("\n")
|
lines = catalogue.resource('concat::fragment', "#{title}_upstream_#{param[:fragment]}").send(:parameters)[:content].split("\n")
|
||||||
|
@ -115,7 +114,7 @@ describe 'nginx::resource::upstream' do
|
||||||
}
|
}
|
||||||
) end
|
) end
|
||||||
|
|
||||||
it { is_expected.to contain_file("/etc/nginx/conf.d/#{title}-upstream.conf").with_ensure('absent') }
|
it { is_expected.to contain_concat("/etc/nginx/conf.d/#{title}-upstream.conf").with_ensure('absent') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue