File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 167
167
$datadir = pick($custom_datadir , " /var/lib/postgresql/${version} /main" )
168
168
$confdir = pick($custom_confdir , " /etc/postgresql/${version} /main" )
169
169
$service_status = " /etc/init.d/${service_name} status | /bin/egrep -q 'Running clusters: .+|online'"
170
+ $python_package_name = " python-psycopg2"
170
171
}
171
172
172
173
default: {
Original file line number Diff line number Diff line change
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' do
37
+ expect { subject } . to raise_error ( /Unsupported osfamily: foo/ )
38
+ end
39
+ end
40
+
41
+ end
You can’t perform that action at this time.
0 commit comments