aboutsummaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorJacob Helwig <jacob@technosorcery.net>2018-06-25 08:27:03 -0700
committerJacob Helwig <jacob@technosorcery.net>2018-06-25 08:27:03 -0700
commit4345a09778021c45f92758d8b13b128c7c4732b1 (patch)
treea2f2338dcd8de9c78e70b749d71f1604a0b2aefe /spec/unit
parent5cd5a464c6d86c475aeb5309f102fecce8044bda (diff)
downloadpuppet-sshkeys_core-4345a09778021c45f92758d8b13b128c7c4732b1.tar.gz
puppet-sshkeys_core-4345a09778021c45f92758d8b13b128c7c4732b1.tar.bz2
Remove Rubocop RSpec/InstanceVariable violations
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/type/ssh_authorized_key_spec.rb7
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