| 1 |
# frozen_string_literal: true |
| 2 |
|
| 3 |
require 'spec_helper' |
| 4 |
|
| 5 |
describe 'haproxy::mailer' do |
| 6 |
let :pre_condition do |
| 7 |
'class{"haproxy": |
| 8 |
config_file => "/tmp/haproxy.cfg" |
| 9 |
} |
| 10 |
' |
| 11 |
end |
| 12 |
let(:title) { 'dero' } |
| 13 |
let(:facts) do |
| 14 |
{ |
| 15 |
networking: { |
| 16 |
ip: '1.1.1.1', |
| 17 |
hostname: 'dero' |
| 18 |
}, |
| 19 |
concat_basedir: '/foo', |
| 20 |
os: { |
| 21 |
family: 'RedHat' |
| 22 |
} |
| 23 |
} |
| 24 |
end |
| 25 |
|
| 26 |
context 'with a single mailer' do |
| 27 |
let(:params) do |
| 28 |
{ |
| 29 |
mailers_name: 'tyler', |
| 30 |
port: 1024 |
| 31 |
} |
| 32 |
end |
| 33 |
|
| 34 |
it { |
| 35 |
is_expected.to contain_concat__fragment('haproxy-mailers-tyler-dero').with( |
| 36 |
'order' => '40-mailers-01-tyler-dero', |
| 37 |
'target' => '/tmp/haproxy.cfg', |
| 38 |
'content' => " mailer dero 1.1.1.1:1024\n", |
| 39 |
) |
| 40 |
} |
| 41 |
end |
| 42 |
end |