2013-02-03 18:25:53 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'postgresql::validate_db_connection', :type => :define do
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
:osfamily => 'Debian',
|
2013-08-27 22:43:47 +02:00
|
|
|
:operatingsystem => 'Debian',
|
|
|
|
:operatingsystemrelease => '6.0',
|
2013-02-03 18:25:53 +01:00
|
|
|
}
|
|
|
|
end
|
2013-08-27 22:43:47 +02:00
|
|
|
|
2013-02-03 18:25:53 +01:00
|
|
|
let :title do
|
|
|
|
'test'
|
|
|
|
end
|
2013-08-27 22:43:47 +02:00
|
|
|
|
2013-10-23 23:49:16 +02:00
|
|
|
describe 'should work with only default parameters' do
|
2014-07-09 18:04:43 +02:00
|
|
|
it { is_expected.to contain_postgresql__validate_db_connection('test') }
|
2013-10-23 23:49:16 +02:00
|
|
|
end
|
|
|
|
|
2013-08-27 22:43:47 +02:00
|
|
|
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,
|
2013-10-23 23:49:16 +02:00
|
|
|
:run_as => 'postgresq',
|
|
|
|
:sleep => 4,
|
|
|
|
:tries => 30,
|
2013-08-27 22:43:47 +02:00
|
|
|
}
|
|
|
|
end
|
2014-07-09 18:04:43 +02:00
|
|
|
it { is_expected.to contain_postgresql__validate_db_connection('test') }
|
2013-02-03 18:25:53 +01:00
|
|
|
end
|
|
|
|
end
|