From 1dd4e78d6c7626ee8388bd28bacc78451df257d2 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 17 Aug 2024 01:49:55 +0200 Subject: [PATCH 1/2] Move expectation out of let block Otherwise it isn't executed. Fixes: ec74a8e5f73130b0a0d5c0dd645e847a2787421f ("Add support for setting UserDir in Virtual Hosts") --- spec/defines/vhost_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index f448b8ca5..aeed564b6 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -2171,12 +2171,12 @@ 'enabled bob', ], ) + end - it { - expect(subject).to contain_concat__fragment('rspec.example.com-apache-userdir') - .with(content: %r{^\s+UserDir disabled$}) - .with(content: %r{^\s+UUserDir enabled bob$}) - } + it do + expect(subject).to contain_concat__fragment('rspec.example.com-userdir') + .with(content: %r{^\s+UserDir disabled$}) + .with(content: %r{^\s+UserDir enabled bob$}) end end end From 16a0d0a3a726fc8f0142129502ba1d8280d92523 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 17 Aug 2024 14:03:33 +0200 Subject: [PATCH 2/2] Add additional verifications to userdir testing --- spec/defines/vhost_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index aeed564b6..b4533daaf 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -2173,6 +2173,8 @@ ) end + it { is_expected.to compile.with_all_deps } + it { is_expected.to contain_class('apache::mod::userdir') } it do expect(subject).to contain_concat__fragment('rspec.example.com-userdir') .with(content: %r{^\s+UserDir disabled$})