Skip to content

Commit 6a68ec9

Browse files
committed
update spec tests
1 parent 7f3ac0c commit 6a68ec9

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

spec/spec_helper_local.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def param(type, title, param)
4444
param_value(catalogue, type, title, param)
4545
end
4646

47+
def postgresql_version
48+
'9.6'
49+
end
50+
4751
shared_examples 'postgresql_password function' do
4852
it { is_expected.not_to eq(nil) }
4953

spec/unit/classes/server/config_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
end
3333

3434
it 'has SELinux port defined' do
35-
is_expected.to contain_package('policycoreutils-python') .with(ensure: 'present')
35+
is_expected.to contain_package('policycoreutils-python').with(ensure: 'installed')
3636

3737
is_expected.to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
3838
.with(unless: '/usr/sbin/semanage port -l | grep -qw 5432')
@@ -141,7 +141,7 @@ class { 'postgresql::server': }
141141
end
142142

143143
it 'has SELinux port defined' do
144-
is_expected.to contain_package('policycoreutils-python-utils') .with(ensure: 'present')
144+
is_expected.to contain_package('policycoreutils-python-utils').with(ensure: 'installed')
145145

146146
is_expected.to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
147147
.with(unless: '/usr/sbin/semanage port -l | grep -qw 5432')
@@ -214,7 +214,7 @@ class { 'postgresql::server': }
214214
end
215215

216216
it 'has SELinux port defined' do
217-
is_expected.to contain_package('policycoreutils-python-utils') .with(ensure: 'present')
217+
is_expected.to contain_package('policycoreutils-python-utils').with(ensure: 'installed')
218218

219219
is_expected.to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
220220
.with(unless: '/usr/sbin/semanage port -l | grep -qw 5432')
@@ -282,7 +282,7 @@ class { 'postgresql::server': }
282282
end
283283

284284
it 'has SELinux port defined' do
285-
is_expected.to contain_package('policycoreutils') .with(ensure: 'present')
285+
is_expected.to contain_package('policycoreutils').with(ensure: 'installed')
286286

287287
is_expected.to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
288288
.with(unless: '/usr/sbin/semanage port -l | grep -qw 5432')

spec/unit/defines/server/default_privileges_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# frozen_string_literal: true
22

33
require 'spec_helper'
4-
require 'spec_helper_acceptance'
54

65
describe 'postgresql::server::default_privileges', type: :define do
76
let :facts do

spec/unit/defines/server/extension_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
it {
5656
is_expected.to contain_package('postgis')
57-
.with(ensure: 'present', name: 'postgis').that_comes_before('Postgresql_psql[template_postgis: CREATE EXTENSION "postgis"]')
57+
.with(ensure: 'installed', name: 'postgis').that_comes_before('Postgresql_psql[template_postgis: CREATE EXTENSION "postgis"]')
5858
}
5959
end
6060

@@ -86,7 +86,7 @@
8686

8787
it {
8888
is_expected.to contain_package('postgis')
89-
.with(ensure: 'present', name: 'postgis').that_requires('Postgresql_psql[template_postgis: DROP EXTENSION "postgis"]')
89+
.with(ensure: 'installed', name: 'postgis').that_requires('Postgresql_psql[template_postgis: DROP EXTENSION "postgis"]')
9090
}
9191
end
9292
end

0 commit comments

Comments
 (0)