Debian Codegraph @

spec/defines/mapfile_entry_spec.rb

raw
1 # frozen_string_literal: true
2
3 require 'spec_helper'
4
5 describe 'haproxy::mapfile::entry' do
6 let(:pre_condition) { 'include haproxy' }
7 let(:title) { 'example.com example-backend' }
8 let(:facts) do
9 {
10 networking: {
11 ip: '1.1.1.1'
12 },
13 os: {
14 family: 'Redhat'
15 },
16 concat_basedir: '/dne'
17 }
18 end
19
20 context 'when map domains to backends' do
21 let(:params) do
22 {
23 mapfile: 'domains-to-backends'
24 }
25 end
26
27 it { is_expected.to compile.with_all_deps }
28
29 it {
30 is_expected.to contain_concat__fragment('haproxy_mapfile_domains-to-backends-example.com example-backend').with(
31 'order' => '10',
32 'target' => '/etc/haproxy/domains-to-backends.map',
33 'content' => "example.com example-backend\n",
34 )
35 }
36 end
37 end