Skip to content

Commit 9041c35

Browse files
committed
Use compile.and_raise_error test to test for failure
The global raise_error requires a specific exception class while this only verifies it failed to compile with a specific message.
1 parent 18d1a8a commit 9041c35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/classes/producer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
end
2424

2525
if os_facts[:service_provider] == 'systemd'
26-
it { is_expected.to raise_error(Puppet::Error, %r{Console Producer is not supported on systemd, because the stdin of the process cannot be redirected}) }
26+
it { is_expected.to compile.and_raise_error(%r{Console Producer is not supported on systemd, because the stdin of the process cannot be redirected}) }
2727
else
2828
it { is_expected.to contain_class('kafka::producer::install').that_comes_before('Class[kafka::producer::config]') }
2929
it { is_expected.to contain_class('kafka::producer::config').that_comes_before('Class[kafka::producer::service]') }

0 commit comments

Comments
 (0)