From 4345a09778021c45f92758d8b13b128c7c4732b1 Mon Sep 17 00:00:00 2001 From: Jacob Helwig Date: Mon, 25 Jun 2018 08:27:03 -0700 Subject: Remove Rubocop RSpec/InstanceVariable violations --- spec/unit/type/ssh_authorized_key_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'spec/unit') 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 -- cgit v1.2.3