diff options
author | Jacob Helwig <jacob@technosorcery.net> | 2018-06-25 09:08:53 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@technosorcery.net> | 2018-06-25 09:08:53 -0700 |
commit | b848ea0ecd6e343f276499698100a9f84255308e (patch) | |
tree | f3f8aab27b13cda8f8946399beebbee73030a189 /spec | |
parent | 7bda4caa4f26d379bc119e9c06f9b3685f20668c (diff) | |
download | puppet-sshkeys_core-b848ea0ecd6e343f276499698100a9f84255308e.tar.gz puppet-sshkeys_core-b848ea0ecd6e343f276499698100a9f84255308e.tar.bz2 |
Fix duplicate test removing RSpec/RepeatedExample violation
The "array host_alias" test was never actually testing against a list of
host aliases, as it was using the exact same code as the "single
host_alias" test. We now test against an actual array of host aliases in
the manifest, and check that it is properly written out to the file.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/integration/provider/sshkey_spec.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/integration/provider/sshkey_spec.rb b/spec/integration/provider/sshkey_spec.rb index ffcf932..3f70dd2 100644 --- a/spec/integration/provider/sshkey_spec.rb +++ b/spec/integration/provider/sshkey_spec.rb @@ -28,7 +28,6 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)', 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' } @@ -118,7 +117,7 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)', end # single host_alias - it 'updates an entry with new host_alias' do + it 'updates an entry with a single new host_alias' do manifest = "#{type_under_test} { '#{sshkey_name}': ensure => 'present', host_aliases => '#{host_alias}', @@ -129,14 +128,13 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), '(integration)', end # array host_alias - - it 'updates an entry with new host_alias' do + it 'updates an entry with multiple new host_aliases' do manifest = "#{type_under_test} { '#{sshkey_name}': - ensure => 'present', - host_aliases => '#{host_alias}', - target => '#{sshkey_file}' }" + ensure => 'present', + host_aliases => [ 'r0ckdata.com', 'erict.net' ], + target => '#{sshkey_file}' }" apply_with_error_check(manifest) - expect(File.read(sshkey_file)).to match(%r{#{sshkey_name},#{host_alias}\s}) + expect(File.read(sshkey_file)).to match(%r{#{sshkey_name},r0ckdata\.com,erict\.net\s}) expect(File.read(sshkey_file)).not_to match(%r{#{sshkey_name}\s}) end |