forked from puppetlabs/puppetlabs-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_entry_spec.rb
44 lines (35 loc) · 1.21 KB
/
config_entry_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
require 'spec_helper_acceptance'
describe 'postgresql::server::config_entry:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
after :all do
# Cleanup after tests have ran
apply_manifest("class { 'postgresql::server': ensure => absent }", :catch_failures => true)
end
it 'should change setting and reflect it in show all' do
pp = <<-EOS.unindent
class { 'postgresql::server': }
postgresql::server::config_entry { 'check_function_bodies':
value => 'off',
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
psql('--command="show all" postgres') do |r|
expect(r.stdout).to match(/check_function_bodies.+off/)
expect(r.stderr).to eq('')
end
end
it 'should correctly set a quotes-required string' do
pp = <<-EOS.unindent
class { 'postgresql::server': }
postgresql::server::config_entry { 'listen_addresses':
value => '0.0.0.0',
}
EOS
apply_manifest(pp, :catch_failures => true)
psql('--command="show all" postgres') do |r|
r.stdout.should =~ /listen_adresses.+0\.0\.0\.0/
r.stderr.should be_empty
r.exit_code.should == 0
end
end
end