summaryrefslogtreecommitdiff
path: root/spec/defines/balancermember_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/defines/balancermember_spec.rb')
-rw-r--r--spec/defines/balancermember_spec.rb43
1 files changed, 31 insertions, 12 deletions
diff --git a/spec/defines/balancermember_spec.rb b/spec/defines/balancermember_spec.rb
index 75b761e..4566ca4 100644
--- a/spec/defines/balancermember_spec.rb
+++ b/spec/defines/balancermember_spec.rb
@@ -7,17 +7,36 @@ describe 'haproxy::balancermember' do
:hostname => 'dero'
}
end
- let(:params) do
- { :name => 'tyler',
- :listening_service => 'croy',
- :balancer_port => '18140',
- :balancermember_options => 'check'
- }
+
+ context 'with a single balancermember option' do
+ let(:params) do
+ { :name => 'tyler',
+ :listening_service => 'croy',
+ :balancer_port => '18140',
+ :balancermember_options => 'check'
+ }
+ end
+
+ it { should contain_concat__fragment('croy_balancermember_tyler').with(
+ 'order' => '20',
+ 'target' => '/etc/haproxy/haproxy.cfg',
+ 'content' => " server dero 1.1.1.1:18140 check\n"
+ ) }
end
- it { should contain_concat__fragment('croy_balancermember_tyler').with(
- 'order' => '20',
- 'target' => '/etc/haproxy/haproxy.cfg',
- 'content' => " server dero 1.1.1.1:18140 check \n"
- ) }
-end \ No newline at end of file
+ context 'with multiple balancermember options' do
+ let(:params) do
+ { :name => 'tyler',
+ :listening_service => 'croy',
+ :balancer_port => '18140',
+ :balancermember_options => ['check', 'close']
+ }
+ end
+
+ it { should contain_concat__fragment('croy_balancermember_tyler').with(
+ 'order' => '20',
+ 'target' => '/etc/haproxy/haproxy.cfg',
+ 'content' => " server dero 1.1.1.1:18140 check close\n"
+ ) }
+ end
+end