Skip to content

Commit

Permalink
Merge pull request #632 from jfryman/update-upstream-tests
Browse files Browse the repository at this point in the history
spec: update upstream_spec for puppetlabs-concat 2
  • Loading branch information
3flex committed May 19, 2015
2 parents 9d45695 + c143078 commit c092c5a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions spec/defines/resource_upstream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
describe 'basic assumptions' do
let :params do default_params end

it { is_expected.to contain_class('concat::setup') }
it { is_expected.to contain_file("/etc/nginx/conf.d/#{title}-upstream.conf") }
it { is_expected.to contain_concat("/etc/nginx/conf.d/#{title}-upstream.conf") }
it { is_expected.to contain_concat__fragment("#{title}_upstream_header").with_content(/upstream #{title}/) }

it {
Expand Down Expand Up @@ -96,7 +95,7 @@
context "when #{param[:attr]} is #{param[:value]}" do
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 param[:title] do
lines = catalogue.resource('concat::fragment', "#{title}_upstream_#{param[:fragment]}").send(:parameters)[:content].split("\n")
Expand All @@ -115,7 +114,7 @@
}
) 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
Expand Down

0 comments on commit c092c5a

Please sign in to comment.