995e1983f2
* Add param `validcon_path` in `postgresql::client` (defaults to previous hard coded value). * Add tests for this new parameter. All tests runs successfully on Scientific Linux 6.4 ``` $ bundle exec rake spec SPEC_OPTS='--format documentation' [...] Finished in 2 minutes 10.5 seconds (files took 1.4 seconds to load) 201 examples, 0 failures ```
47 lines
1.1 KiB
Ruby
47 lines
1.1 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'postgresql::client', :type => :class do
|
|
let :facts do
|
|
{
|
|
:osfamily => 'Debian',
|
|
:operatingsystem => 'Debian',
|
|
:operatingsystemrelease => '6.0',
|
|
}
|
|
end
|
|
|
|
describe 'with parameters' do
|
|
let :params do
|
|
{
|
|
:validcon_script_path => '/opt/bin/my-validate-con.sh',
|
|
:package_ensure => 'absent',
|
|
:package_name => 'mypackage',
|
|
:file_ensure => 'file'
|
|
}
|
|
end
|
|
|
|
it 'should modify package' do
|
|
is_expected.to contain_package("postgresql-client").with({
|
|
:ensure => 'absent',
|
|
:name => 'mypackage',
|
|
:tag => 'postgresql',
|
|
})
|
|
end
|
|
|
|
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
|
|
end
|
|
|
|
describe 'with no parameters' do
|
|
it 'should create package with postgresql tag' do
|
|
is_expected.to contain_package('postgresql-client').with({
|
|
:tag => 'postgresql',
|
|
})
|
|
end
|
|
end
|
|
end
|