- let :params do
- {
- :database_host => 'test',
- :database_name => 'test',
- :database_password => 'test',
- :database_username => 'test',
- }
+
+ describe 'should work with only default parameters' do
+ it { is_expected.to contain_postgresql__validate_db_connection('test') }
+ end
+
+ describe 'should work with all parameters' do
+ let :params do
+ {
+ :database_host => 'test',
+ :database_name => 'test',
+ :database_password => 'test',
+ :database_username => 'test',
+ :database_port => 5432,
+ :run_as => 'postgresq',
+ :sleep => 4,
+ :tries => 30,
+ }
+ end
+ it { is_expected.to contain_postgresql__validate_db_connection('test') }
+
+ it 'should have proper path for validate command' do
+ is_expected.to contain_exec('validate postgres connection for test@test:5432/test').with({
+ :unless => %r'^/usr/local/bin/validate_postgresql_connection.sh\s+\d+'
+ })
+ end