fuel-library/deployment/puppet/haproxy/spec/defines/peer_spec.rb
Stanislaw Bogatkin 1a0f3c0a6d Sync puppet haproxy module from upstream
UP link: https://github.com/puppetlabs/puppetlabs-haproxy
UP commit sha: 4c94112afbb143f54caae0967e29261b41179017
Implements: blueprint ssl-endpoints

Change-Id: Icb96703ad50b111af463cb6c4094091a251ca680
2015-06-18 10:12:07 -05:00

41 lines
812 B
Ruby

require 'spec_helper'
describe 'haproxy::peer' do
let(:title) { 'dero' }
let(:facts) do
{
:ipaddress => '1.1.1.1',
:hostname => 'dero',
}
end
context 'with a single peer' do
let(:params) do
{
:peers_name => 'tyler',
:port => 1024,
}
end
it { should contain_concat__fragment('peers-tyler-dero').with(
'order' => '30-peers-01-tyler-dero',
'target' => '/etc/haproxy/haproxy.cfg',
'content' => " peer dero 1.1.1.1:1024\n"
) }
end
context 'remove a peer' do
let(:params) do
{
:peers_name => 'tyler',
:port => 1024,
:ensure => 'absent'
}
end
it { should contain_concat__fragment('peers-tyler-dero').with(
'ensure' => 'absent'
) }
end
end