From a0e961674b96c070e0a32bce3f224a1512aa128d Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 2 Feb 2014 17:48:24 +0100 Subject: tests for ssh authorized key --- spec/defines/ssh_authorized_key_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 spec/defines/ssh_authorized_key_spec.rb diff --git a/spec/defines/ssh_authorized_key_spec.rb b/spec/defines/ssh_authorized_key_spec.rb new file mode 100644 index 0000000..a554d9d --- /dev/null +++ b/spec/defines/ssh_authorized_key_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe 'sshd::ssh_authorized_key' do + + context 'add authorized key' do + let(:title) { 'foo' } + let(:ssh_key) { 'some_secret_ssh_key' } + + let(:params) {{ + :key => ssh_key, + }} + + it { should contain_ssh_authorized_key('foo').with({ + 'ensure' => 'present', + 'type' => 'ssh-dss', + 'user' => 'foo', + 'target' => '/home/foo/.ssh/authorized_keys', + 'key' => ssh_key, + }) + } + end +end -- cgit v1.2.3