File: postfix_canonical_spec.rb

package info (click to toggle)
puppet-module-camptocamp-postfix 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 576 kB
  • sloc: ruby: 1,544; sh: 10; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 941 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
# frozen_string_literal: true

require 'spec_helper'

describe 'postfix::canonical' do
  let(:title) { 'foo@example.com' }

  on_supported_os.each do |os, os_facts|
    context "on #{os}" do
      let(:facts) do
        os_facts
      end
      let(:params) do
        {
          ensure: 'present',
          file: '/etc/postfix/recipient_canonical',
          destination: 'root',
        }
      end

      context 'without related postfix::map resource' do
        it { is_expected.not_to compile.with_all_deps }
      end

      context 'with related postfix::map resource' do
        let :pre_condition do
          <<-PUPPET
          postfix::config { 'canonical_alias_maps':
           value => 'hash:/etc/postfix/recipient_canonical',
          }
          postfix::hash { '/etc/postfix/recipient_canonical':
          }
          PUPPET
        end

        it { is_expected.to compile.with_all_deps }
      end
    end
  end
end