diff options
author | Hunter Haugen <h.haugen@gmail.com> | 2012-10-12 11:48:35 -0700 |
---|---|---|
committer | Hunter Haugen <h.haugen@gmail.com> | 2012-10-12 11:53:52 -0700 |
commit | de367852d14c8c205c06cb6bfa9555fe01165a41 (patch) | |
tree | 4c07f89af518c81c4d76ec905e38547ada6af0bc /spec | |
parent | 3ab65f56a61cfedbe75a3b41143f0d44fbad0a93 (diff) |
Update ports to also accept a ,-separated string
Diffstat (limited to 'spec')
-rw-r--r-- | spec/defines/listen_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/defines/listen_spec.rb b/spec/defines/listen_spec.rb index c4539b8..16a0cfa 100644 --- a/spec/defines/listen_spec.rb +++ b/spec/defines/listen_spec.rb @@ -5,7 +5,8 @@ describe 'haproxy::listen' do let(:facts) {{ :ipaddress => '1.1.1.1' }} context "when only one port is provided" do let(:params) do - { :name => 'croy', + { + :name => 'croy', :ports => '18140' } end @@ -18,7 +19,8 @@ describe 'haproxy::listen' do end context "when an array of ports is provided" do let(:params) do - { :name => 'apache', + { + :name => 'apache', :ipaddress => '23.23.23.23', :ports => [ '80', @@ -33,4 +35,19 @@ describe 'haproxy::listen' do 'content' => "\nlisten apache 23.23.23.23:80,23.23.23.23:443\n balance roundrobin\n option tcplog\n option ssl-hello-chk\n" ) } end + context "when a comma-separated list of ports is provided" do + let(:params) do + { + :name => 'apache', + :ipaddress => '23.23.23.23', + :ports => '80,443' + } + end + + it { should contain_concat__fragment('apache_listen_block').with( + 'order' => '20', + 'target' => '/etc/haproxy/haproxy.cfg', + 'content' => "\nlisten apache 23.23.23.23:80,23.23.23.23:443\n balance roundrobin\n option tcplog\n option ssl-hello-chk\n" + ) } + end end |