Skip to content

Commit 2be5b18

Browse files
Copilotdamacus
andauthored
fix(tests): Add unit test coverage for haproxy_listen option parameter (already implemented) (#550)
* Add unit test for haproxy_listen option parameter Co-authored-by: damacus <40786+damacus@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: damacus <40786+damacus@users.noreply.github.com> Co-authored-by: Dan Webb <dan.webb@damacus.io>
1 parent 343fa24 commit 2be5b18

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

spec/unit/recipes/listen_spec.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,28 @@
3939
it { is_expected.to render_file('/etc/haproxy/haproxy.cfg').with_content(/#{cfg_content.join('\n')}/) }
4040
end
4141

42+
context 'option parameter with array of options' do
43+
recipe do
44+
haproxy_install 'package'
45+
46+
haproxy_listen 'test_options' do
47+
bind '0.0.0.0:1337'
48+
mode 'http'
49+
option %w(dontlog-normal forwardfor)
50+
end
51+
end
52+
53+
cfg_content = [
54+
'listen test_options',
55+
' mode http',
56+
' bind 0.0.0.0:1337',
57+
' option dontlog-normal',
58+
' option forwardfor',
59+
]
60+
61+
it { is_expected.to render_file('/etc/haproxy/haproxy.cfg').with_content(/#{cfg_content.join('\n')}/) }
62+
end
63+
4264
context 'extra options hash with disabled option' do
4365
recipe do
4466
haproxy_install 'package'

0 commit comments

Comments
 (0)