newer pg module
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / spec / acceptance / default_parameters_spec.rb
diff --git a/3rdparty/modules/postgresql/spec/acceptance/default_parameters_spec.rb b/3rdparty/modules/postgresql/spec/acceptance/default_parameters_spec.rb
new file mode 100644 (file)
index 0000000..4763482
--- /dev/null
@@ -0,0 +1,28 @@
+require 'spec_helper_acceptance'
+
+# These tests are designed to ensure that the module, when ran with defaults,
+# sets up everything correctly and allows us to connect to Postgres.
+describe 'postgresql::server', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
+  it 'with defaults' do
+    pp = <<-EOS
+      class { 'postgresql::server': }
+    EOS
+
+    apply_manifest(pp, :catch_failures => true)
+    apply_manifest(pp, :catch_changes => true)
+  end
+
+  describe port(5432) do
+    it { is_expected.to be_listening }
+  end
+
+  it 'can connect with psql' do
+    psql('--command="\l" postgres', 'postgres') do |r|
+      expect(r.stdout).to match(/List of databases/)
+    end
+  end
+
+end
+
+
+