newer pg module
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / spec / acceptance / default_parameters_spec.rb
1 require 'spec_helper_acceptance'
2
3 # These tests are designed to ensure that the module, when ran with defaults,
4 # sets up everything correctly and allows us to connect to Postgres.
5 describe 'postgresql::server', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
6   it 'with defaults' do
7     pp = <<-EOS
8       class { 'postgresql::server': }
9     EOS
10
11     apply_manifest(pp, :catch_failures => true)
12     apply_manifest(pp, :catch_changes => true)
13   end
14
15   describe port(5432) do
16     it { is_expected.to be_listening }
17   end
18
19   it 'can connect with psql' do
20     psql('--command="\l" postgres', 'postgres') do |r|
21       expect(r.stdout).to match(/List of databases/)
22     end
23   end
24
25 end
26
27
28