Add test on postgresql::python.

This commit is contained in:
Dan Prince 2013-04-22 11:30:07 -04:00
parent bd9bcf4cc2
commit 03b3df3ab9
2 changed files with 42 additions and 0 deletions

View file

@ -167,6 +167,7 @@ class postgresql::params(
$datadir = pick($custom_datadir, "/var/lib/postgresql/${version}/main")
$confdir = pick($custom_confdir, "/etc/postgresql/${version}/main")
$service_status = "/etc/init.d/${service_name} status | /bin/egrep -q 'Running clusters: .+|online'"
$python_package_name = "python-psycopg2"
}
default: {

View file

@ -0,0 +1,41 @@
require 'spec_helper'
describe 'postgresql::python', :type => :class do
describe 'on a redhat based os' do
let :facts do {
:osfamily => 'RedHat',
:postgres_default_version => 'foo',
}
end
it { should contain_package('python-psycopg2').with(
:name => 'python-psycopg2',
:ensure => 'present'
)}
end
describe 'on a debian based os' do
let :facts do {
:osfamily => 'Debian',
:postgres_default_version => 'foo',
}
end
it { should contain_package('python-psycopg2').with(
:name => 'python-psycopg2',
:ensure => 'present'
)}
end
describe 'on any other os' do
let :facts do {
:osfamily => 'foo',
:postgres_default_version => 'foo',
}
end
it 'should fail' do
expect { subject }.to raise_error(/Unsupported osfamily: foo/)
end
end
end