aboutsummaryrefslogtreecommitdiff
path: root/spec/integration/provider
diff options
context:
space:
mode:
authorJacob Helwig <jacob@technosorcery.net>2018-06-25 08:47:52 -0700
committerJacob Helwig <jacob@technosorcery.net>2018-06-25 08:47:52 -0700
commit7bda4caa4f26d379bc119e9c06f9b3685f20668c (patch)
tree46e2b7b74ded72e2da38092fa7b84508eb8157b6 /spec/integration/provider
parent57627232e03efb177cf9c4c65de1e23417516fb5 (diff)
downloadpuppet-sshkeys_core-7bda4caa4f26d379bc119e9c06f9b3685f20668c.tar.gz
puppet-sshkeys_core-7bda4caa4f26d379bc119e9c06f9b3685f20668c.tar.bz2
Remove Rubocop RSpec/ScatteredLet violations
Diffstat (limited to 'spec/integration/provider')
-rw-r--r--spec/integration/provider/sshkey_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/integration/provider/sshkey_spec.rb b/spec/integration/provider/sshkey_spec.rb
index 47af892..ffcf932 100644
--- a/spec/integration/provider/sshkey_spec.rb
+++ b/spec/integration/provider/sshkey_spec.rb
@@ -9,6 +9,7 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)',
include PuppetSpec::Compiler
let(:sshkey_file) { tmpfile('sshkey_integration_specs') }
+ let(:type_under_test) { 'sshkey' }
before :each do
# Don't backup to filebucket
@@ -25,10 +26,13 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)',
described_class.clear
end
- let(:type_under_test) { 'sshkey' }
-
describe 'when managing a ssh known hosts file it...' do
+ let(:host_alias) { 'r0ckdata.com' }
+ let(:host_aliases) { 'r0ckdata.com,erict.net' }
+ let(:invalid_type) { 'ssh-er0ck' }
+ let(:sshkey_name) { 'kirby.madstop.com' }
let(:super_unique) { 'my.super.unique.host' }
+
it 'creates a new known_hosts file with mode 0644' do
target = tmpfile('ssh_known_hosts')
manifest = "#{type_under_test} { '#{super_unique}':
@@ -50,7 +54,6 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)',
expect(File.read(sshkey_file)).to match(%r{#{super_unique}.*mykey})
end
- let(:sshkey_name) { 'kirby.madstop.com' }
it 'deletes an entry for an SSH host key' do
manifest = "#{type_under_test} { '#{sshkey_name}':
ensure => 'absent',
@@ -103,7 +106,6 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)',
end
# test unknown key type fails
- let(:invalid_type) { 'ssh-er0ck' }
it 'raises an error with an unknown type' do
manifest = "#{type_under_test} { '#{sshkey_name}':
ensure => 'present',
@@ -116,7 +118,6 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)',
end
# single host_alias
- let(:host_alias) { 'r0ckdata.com' }
it 'updates an entry with new host_alias' do
manifest = "#{type_under_test} { '#{sshkey_name}':
ensure => 'present',
@@ -128,7 +129,6 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)',
end
# array host_alias
- let(:host_aliases) { 'r0ckdata.com,erict.net' }
it 'updates an entry with new host_alias' do
manifest = "#{type_under_test} { '#{sshkey_name}':