fuel-library/deployment/puppet/haproxy/spec/defines/backend_spec.rb
Alex Schultz b42197bfd5 Make haproxy tests to be rspec-puppet 2 compatible
This change pulls in the upstream commit
eef121eddf659e66e13157033496def216d69af4 to make the haproxy module
rspec-puppet 2 compatible so that they can pass under our
openstack-infra tests.

Additionally we are updating the rspec-core to ~> 3.3 to be consistent
with the other modules in fuel-library.

Change-Id: I93800486b5d8e0f4cd06e6d583d8fecfa28d9a52
Closes-Bug: #1508983
2015-10-22 14:59:36 -05:00

37 lines
917 B
Ruby

require 'spec_helper'
describe 'haproxy::backend' do
let(:pre_condition) { 'include haproxy' }
let(:facts) do
{
:ipaddress => '1.1.1.1',
:osfamily => 'Redhat',
:concat_basedir => '/dne',
}
end
context "when no options are passed" do
let(:title) { 'bar' }
it { should contain_concat__fragment('bar_backend_block').with(
'order' => '20-bar-00',
'target' => '/etc/haproxy/haproxy.cfg',
'content' => "\nbackend bar\n balance roundrobin\n option tcplog\n option ssl-hello-chk\n"
) }
end
# C9953
context "when a listen is created with the same name" do
let(:title) { 'apache' }
let(:pre_condition) do
"haproxy::listen { 'apache': ports => '443', }"
end
it 'should raise error' do
expect { catalogue }.to raise_error Puppet::Error, /discovered with the same name/
end
end
# C9956 WONTFIX
end