Skip to content

Commit a1033e9

Browse files
committed
Fix spec tests
In a bad rebase I introduced a test failure. Fixes: f4a42a7
1 parent ad3e1ea commit a1033e9

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

spec/classes/server/config_spec.rb

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -216,34 +216,37 @@ class { 'postgresql::server':
216216
describe 'on Gentoo' do
217217
include_examples 'Gentoo'
218218

219-
let(:pre_condition) do
220-
<<-EOS
221-
class { 'postgresql::globals':
222-
version => '9.5',
223-
}->
224-
class { 'postgresql::server': }
225-
EOS
226-
end
219+
describe 'with systemd' do
220+
let(:facts) { super().merge(service_provider: 'systemd') }
221+
let(:pre_condition) do
222+
<<-EOS
223+
class { 'postgresql::globals':
224+
version => '9.5',
225+
}->
226+
class { 'postgresql::server': }
227+
EOS
228+
end
227229

228-
it 'does not have SELinux port defined' do
229-
is_expected.not_to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
230-
end
230+
it 'does not have SELinux port defined' do
231+
is_expected.not_to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
232+
end
231233

232-
it 'removes the old systemd-override file' do
233-
is_expected.to contain_file('old-systemd-override')
234-
.with(ensure: 'absent', path: '/etc/systemd/system/postgresql-9.5.service')
235-
end
234+
it 'removes the old systemd-override file' do
235+
is_expected.to contain_file('old-systemd-override')
236+
.with(ensure: 'absent', path: '/etc/systemd/system/postgresql-9.5.service')
237+
end
236238

237-
it 'has the correct systemd-override drop file' do
238-
is_expected.to contain_file('systemd-override').with(
239-
ensure: 'file', path: '/etc/systemd/system/postgresql-9.5.service.d/postgresql-9.5.conf',
240-
owner: 'root', group: 'root'
241-
)
242-
end
239+
it 'has the correct systemd-override drop file' do
240+
is_expected.to contain_file('systemd-override').with(
241+
ensure: 'file', path: '/etc/systemd/system/postgresql-9.5.service.d/postgresql-9.5.conf',
242+
owner: 'root', group: 'root'
243+
)
244+
end
243245

244-
it 'has the correct systemd-override file #regex' do
245-
is_expected.to contain_file('systemd-override') \
246-
.with_content(%r{(?!^.include)})
246+
it 'has the correct systemd-override file #regex' do
247+
is_expected.to contain_file('systemd-override') \
248+
.with_content(%r{(?!^.include)})
249+
end
247250
end
248251
end
249252
end

spec/classes/server/contrib_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
describe 'on Gentoo' do
3434
include_examples 'Gentoo'
3535

36-
it 'fails to compile' do
37-
is_expected.to compile.and_raise_error(%r{is not supported})
36+
it 'postgresql-contrib should not be installed' do
37+
is_expected.to compile
38+
is_expected.not_to contain_package('postgresql-contrib')
3839
end
3940
end
4041

0 commit comments

Comments
 (0)