3 describe 'postgresql::server::reassign_owned_by', :type => :define do
7 :operatingsystem => 'Debian',
8 :operatingsystemrelease => '6.0',
10 :concat_basedir => tmpfilename('reassign_owned_by'),
12 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
23 :old_role => 'test_old_role',
24 :new_role => 'test_new_role',
30 class {'postgresql::server':}
31 postgresql::server::role{ ['test_old_role','test_new_role']: }
35 it { is_expected.to contain_postgresql__server__reassign_owned_by('test') }
38 is_expected.to contain_postgresql_psql('reassign_owned_by:test:REASSIGN OWNED BY "test_old_role" TO "test_new_role"').with({
39 'command' => "REASSIGN OWNED BY \"test_old_role\" TO \"test_new_role\"",
40 'onlyif' => /SELECT tablename FROM pg_catalog.pg_tables WHERE\s*schemaname NOT IN \('pg_catalog', 'information_schema'\) AND\s*tableowner = 'test_old_role'.*/m,
41 }).that_requires('Class[postgresql::server]')