module-postgresql/spec/unit/classes/postgresql_java_spec.rb
Chris Price 6bd2befa98 Add support for other operating systems besides Redhat/Debian
Prior to this commit, if you attempted to use the module to
manage postgres on any OS other than Redhat/Debian, there
was an explicit check for that, and a call to `fail`.

In reality, the OS family is only used to build up defaults
for various path and package names, which are all exposed
as parameters.  If the user is willing to explicitly pass
in all of those parameters, there's no reason we should
fail based on OS family.

This commit adds checks to the 'default' osfamily case
such that we now only fail if they're on a non-Redhat-or-Debian
system *and* they haven't explicitly passed in values for
all of the required parameters.
2013-06-06 12:23:30 -07:00

38 lines
954 B
Ruby

require 'spec_helper'
describe 'postgresql::java', :type => :class do
describe 'on a debian based os' do
let :facts do {
:osfamily => 'Debian',
:postgres_default_version => 'foo',
}
end
it { should contain_package('postgresql-jdbc').with(
:name => 'libpostgresql-jdbc-java',
:ensure => 'present'
)}
end
describe 'on a redhat based os' do
let :facts do {
:osfamily => 'RedHat',
:postgres_default_version => 'foo',
}
end
it { should contain_package('postgresql-jdbc').with(
:name => 'postgresql-jdbc',
:ensure => 'present'
)}
describe 'when parameters are supplied' do
let :params do
{:package_ensure => 'latest', :package_name => 'somepackage'}
end
it { should contain_package('postgresql-jdbc').with(
:name => 'somepackage',
:ensure => 'latest'
)}
end
end
end