Sha256: 0d72438bdae349221b46378efdea5c7664e3fd3b21ff567e0f58e5f92a135611

Contents?: true

Size: 849 Bytes

Versions: 7

Compression:

Stored size: 849 Bytes

Contents

require 'spec_helper_acceptance'

describe 'postgresql::server::database:' do
  after :all do
    # Cleanup after tests have ran
    apply_manifest("class { 'postgresql::server': ensure => absent }", :catch_failures => true)
  end

  it 'should idempotently create a db that we can connect to' do
    begin
      pp = <<-EOS.unindent
        $db = 'postgresql_test_db'
        class { 'postgresql::server': }

        postgresql::server::database { $db: }
      EOS

      apply_manifest(pp, :catch_failures => true)
      apply_manifest(pp, :catch_changes => true)

      psql('--command="select datname from pg_database" postgresql_test_db') do |r|
        expect(r.stdout).to match(/postgresql_test_db/)
        expect(r.stderr).to eq('')
      end
    ensure
      psql('--command="drop database postgresql_test_db" postgres')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/postgresql/spec/acceptance/server/database_spec.rb
freighthop-0.6.0 modules/postgresql/spec/acceptance/server/database_spec.rb
freighthop-0.5.2 modules/postgresql/spec/acceptance/server/database_spec.rb
freighthop-0.5.1 modules/postgresql/spec/acceptance/server/database_spec.rb
freighthop-0.5.0 modules/postgresql/spec/acceptance/server/database_spec.rb
freighthop-0.4.1 modules/postgresql/spec/acceptance/server/database_spec.rb
freighthop-0.4.0 modules/postgresql/spec/acceptance/server/database_spec.rb