-
Notifications
You must be signed in to change notification settings - Fork 611
/
Copy pathpg_ident_rule_spec.rb
59 lines (52 loc) · 1.34 KB
/
pg_ident_rule_spec.rb
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
require 'spec_helper'
describe 'postgresql::server::pg_ident_rule' do
include_examples 'Debian 11'
let :title do
'test'
end
let :target do
tmpfilename('pg_ident_rule')
end
context 'managing pg_ident' do
let :pre_condition do
<<-MANIFEST
class { 'postgresql::globals':
manage_pg_ident_conf => true,
}
class { 'postgresql::server': }
MANIFEST
end
let :params do
{
map_name: 'thatsmymap',
system_username: 'systemuser',
database_username: 'dbuser'
}
end
it do
expect(subject).to contain_concat__fragment('pg_ident_rule_test').with(content: %r{thatsmymap\s+systemuser\s+dbuser})
end
end
context 'not managing pg_ident' do
let :pre_condition do
<<-MANIFEST
class { 'postgresql::globals':
manage_pg_ident_conf => false,
}
class { 'postgresql::server': }
MANIFEST
end
let :params do
{
map_name: 'thatsmymap',
system_username: 'systemuser',
database_username: 'dbuser'
}
end
it 'fails because $manage_pg_ident_conf is false' do
expect { catalogue }.to raise_error(Puppet::Error,
%r{postgresql::server::manage_pg_ident_conf has been disabled})
end
end
end