diff options
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/type/ssh_authorized_key_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/unit/type/ssh_authorized_key_spec.rb b/spec/unit/type/ssh_authorized_key_spec.rb index 845cf46..ea32af9 100644 --- a/spec/unit/type/ssh_authorized_key_spec.rb +++ b/spec/unit/type/ssh_authorized_key_spec.rb @@ -169,8 +169,11 @@ describe Puppet::Type.type(:ssh_authorized_key), unless: Puppet.features.microso it 'informs about an absent user' do Puppet::Log.level = :debug - described_class.new(name: 'whev', user: 'idontexist').should(:target) - expect(@logs.map(&:message)).to include('The required user is not yet present on the system') + logs = [] + Puppet::Util::Log.with_destination(Puppet::Test::LogCollector.new(logs)) do + described_class.new(name: 'whev', user: 'idontexist').should(:target) + end + expect(logs.map(&:message)).to include('The required user is not yet present on the system') end end end |