-
Notifications
You must be signed in to change notification settings - Fork 611
/
Copy pathtablespace_spec.rb
54 lines (43 loc) · 1.19 KB
/
tablespace_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
# frozen_string_literal: true
require 'spec_helper'
describe 'postgresql::server::tablespace' do
include_examples 'Debian 11'
let :title do
'test'
end
let :params do
{
location: '/srv/data/foo'
}
end
let :pre_condition do
"class {'postgresql::server':}"
end
it { is_expected.to contain_file('/srv/data/foo').with_ensure('directory') }
it { is_expected.to contain_postgresql__server__tablespace('test') }
it { is_expected.to contain_postgresql_psql('CREATE TABLESPACE "test"').that_requires('Service[postgresqld_instance_main]') }
context 'with different owner' do
let :params do
{
location: '/srv/data/foo',
owner: 'test_owner'
}
end
it { is_expected.to contain_postgresql_psql('ALTER TABLESPACE "test" OWNER TO "test_owner"') }
end
context 'with manage_location set to false' do
let :params do
{
location: '/srv/data/foo',
manage_location: false
}
end
let :pre_condition do
"
class {'postgresql::server':}
file {'/srv/data/foo': ensure => 'directory'}
"
end
it { is_expected.to contain_file('/srv/data/foo').with_ensure('directory') }
end
end