]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
tests for ssh authorized key
authorTomas Barton <barton.tomas@gmail.com>
Sun, 2 Feb 2014 16:48:24 +0000 (17:48 +0100)
committerTomas Barton <barton.tomas@gmail.com>
Sun, 2 Feb 2014 16:48:24 +0000 (17:48 +0100)
spec/defines/ssh_authorized_key_spec.rb [new file with mode: 0644]

diff --git a/spec/defines/ssh_authorized_key_spec.rb b/spec/defines/ssh_authorized_key_spec.rb
new file mode 100644 (file)
index 0000000..a554d9d
--- /dev/null
@@ -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