Sha256: 3bb8cb2128b0103a43887bcfc5d2b10ab79fd69d2d99fe6b3d09cb78a1b9321b

Contents?: true

Size: 916 Bytes

Versions: 7

Compression:

Stored size: 916 Bytes

Contents

require 'spec_helper_system'

describe 'postgresql::server::database:' do
  after :all do
    # Cleanup after tests have ran
    puppet_apply("class { 'postgresql::server': ensure => absent }") do |r|
      r.exit_code.should_not == 1
    end
  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

      puppet_apply(pp) do |r|
        r.exit_code.should_not == 1
        r.refresh
        r.exit_code.should == 0
      end

      psql('--command="select datname from pg_database" postgresql_test_db') do |r|
        r.stdout.should =~ /postgresql_test_db/
        r.stderr.should be_empty
        r.exit_code.should == 0
      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.3.3 modules/postgresql/spec/system/server/database_spec.rb
freighthop-0.3.2 modules/postgresql/spec/system/server/database_spec.rb
freighthop-0.3.1 modules/postgresql/spec/system/server/database_spec.rb
freighthop-0.3.0 modules/postgresql/spec/system/server/database_spec.rb
freighthop-0.2.1 modules/postgresql/spec/system/server/database_spec.rb
freighthop-0.2.0 modules/postgresql/spec/system/server/database_spec.rb
freighthop-0.1.0 modules/postgresql/spec/system/server/database_spec.rb