| 1 |
# frozen_string_literal: true |
| 2 |
|
| 3 |
require 'spec_helper' |
| 4 |
|
| 5 |
describe 'haproxy::mailers' do |
| 6 |
let :pre_condition do |
| 7 |
'class{"haproxy": |
| 8 |
config_file => "/tmp/haproxy.cfg" |
| 9 |
} |
| 10 |
' |
| 11 |
end |
| 12 |
let(:facts) do |
| 13 |
{ |
| 14 |
networking: { |
| 15 |
ip: '1.1.1.1' |
| 16 |
}, |
| 17 |
concat_basedir: '/foo', |
| 18 |
os: { |
| 19 |
family: 'RedHat' |
| 20 |
} |
| 21 |
} |
| 22 |
end |
| 23 |
|
| 24 |
context 'when no options are passed' do |
| 25 |
let(:title) { 'bar' } |
| 26 |
|
| 27 |
it { |
| 28 |
is_expected.to contain_concat__fragment('haproxy-bar_mailers_block').with( |
| 29 |
'order' => '40-mailers-00-bar', |
| 30 |
'target' => '/tmp/haproxy.cfg', |
| 31 |
'content' => "\nmailers bar\n", |
| 32 |
) |
| 33 |
} |
| 34 |
end |
| 35 |
end |