2013-02-03 18:25:53 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'postgresql::client', :type => :class 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
|
|
|
|
|
|
|
describe 'with parameters' do
|
|
|
|
let :params do
|
|
|
|
{
|
2014-04-30 14:30:03 +02:00
|
|
|
:validcon_script_path => '/opt/bin/my-validate-con.sh',
|
2013-08-27 22:43:47 +02:00
|
|
|
:package_ensure => 'absent',
|
2014-04-30 14:30:03 +02:00
|
|
|
:package_name => 'mypackage',
|
|
|
|
:file_ensure => 'file'
|
2013-08-27 22:43:47 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should modify package' do
|
2014-07-09 18:04:43 +02:00
|
|
|
is_expected.to contain_package("postgresql-client").with({
|
2013-08-27 22:43:47 +02:00
|
|
|
:ensure => 'absent',
|
|
|
|
:name => 'mypackage',
|
|
|
|
:tag => 'postgresql',
|
|
|
|
})
|
|
|
|
end
|
2014-04-30 14:30:03 +02:00
|
|
|
|
|
|
|
it 'should have specified validate connexion' do
|
|
|
|
should contain_file('/opt/bin/my-validate-con.sh').with({
|
|
|
|
:ensure => 'file',
|
|
|
|
:owner => 0,
|
|
|
|
:group => 0,
|
|
|
|
:mode => '0755'
|
|
|
|
})
|
|
|
|
end
|
2013-08-27 22:43:47 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with no parameters' do
|
|
|
|
it 'should create package with postgresql tag' do
|
2014-07-09 18:04:43 +02:00
|
|
|
is_expected.to contain_package('postgresql-client').with({
|
2013-08-27 22:43:47 +02:00
|
|
|
:tag => 'postgresql',
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
2013-02-03 18:25:53 +01:00
|
|
|
end
|