Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add rspec test for Class['postgresql::java'].
This test conforms to the rspec-puppet and puppetlabs_spec_helper
standards.
  • Loading branch information
razorsedge committed Jan 21, 2013
commit ba454d406df304377519229cc497828ed9bf1c77
50 changes: 50 additions & 0 deletions spec/classes/postgresql_java_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
require 'spec_helper'

describe 'postgresql::java' 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 => 'java-postgresql'}
end
it { should contain_package('postgresql-jdbc').with(
:name => 'java-postgresql',
:ensure => 'latest'
)}
end
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