File: peer_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-haproxy 8.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 816 kB
  • sloc: ruby: 3,979; sh: 14; makefile: 4
file content (42 lines) | stat: -rw-r--r-- 778 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true

require 'spec_helper'

describe 'haproxy::peer' do
  let :pre_condition do
    'class{"haproxy":
        config_file => "/tmp/haproxy.cfg"
     }
    '
  end
  let(:title) { 'dero' }
  let(:facts) do
    {
      networking: {
        ip: '1.1.1.1',
        hostname: 'dero'
      },
      concat_basedir: '/foo',
      os: {
        family: 'RedHat'
      }
    }
  end

  context 'with a single peer' do
    let(:params) do
      {
        peers_name: 'tyler',
        port: 1024
      }
    end

    it {
      is_expected.to contain_concat__fragment('haproxy-peers-tyler-dero').with(
        'order' => '30-peers-01-tyler-dero',
        'target' => '/tmp/haproxy.cfg',
        'content' => "  peer dero 1.1.1.1:1024\n",
      )
    }
  end
end