salsa: more mail setup
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / spec / unit / classes / postgresql_python_spec.rb
1 require 'spec_helper'
2
3 describe 'postgresql::python', :type => :class do
4
5   describe 'on a redhat based os' do
6     let :facts do {
7       :osfamily                 => 'RedHat',
8       :postgres_default_version => 'foo',
9     }
10     end
11     it { should contain_package('python-psycopg2').with(
12       :name   => 'python-psycopg2',
13       :ensure => 'present'
14     )}
15   end
16
17   describe 'on a debian based os' do
18     let :facts do {
19       :osfamily                 => 'Debian',
20       :postgres_default_version => 'foo',
21     }
22     end
23     it { should contain_package('python-psycopg2').with(
24       :name   => 'python-psycopg2',
25       :ensure => 'present'
26     )}
27   end
28
29   describe 'on any other os' do
30     let :facts do {
31       :osfamily                 => 'foo',
32       :postgres_default_version => 'foo',
33     }
34     end
35
36     it 'should fail without all the necessary parameters' do
37       expect { subject }.to raise_error(/Module postgresql does not provide defaults for osfamily: foo/)
38     end
39   end
40
41   describe 'on any other os without all the necessary parameters' do
42     let :facts do {
43       :osfamily                 => 'foo',
44       :postgres_default_version => 'foo',
45     }
46     end
47
48     it 'should fail' do
49       expect { subject }.to raise_error(/Module postgresql does not provide defaults for osfamily: foo/)
50     end
51   end
52
53 end