From 7a6ae299621a16fa7fd8ab0fbd2c05fe723cffa4 Mon Sep 17 00:00:00 2001 From: Francois Deppierraz Date: Thu, 3 Jul 2008 10:34:49 +0200 Subject: [PATCH] Add a missing test for exercising the last untested line of lib/puppet/type/ssh_authorized_key.rb --- spec/unit/type/ssh_authorized_key.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/unit/type/ssh_authorized_key.rb b/spec/unit/type/ssh_authorized_key.rb index 3c87decf1..0b41af40a 100755 --- a/spec/unit/type/ssh_authorized_key.rb +++ b/spec/unit/type/ssh_authorized_key.rb @@ -118,6 +118,16 @@ describe ssh_authorized_key do @catalog.resource(:file, target).should be_an_instance_of(Puppet::Type.type(:file)) end + it "should raise an error when neither user nor target is given" do + proc do + @class.create( + :name => "Test", + :key => "AAA", + :type => "ssh-rsa", + :ensure => :present) + end.should raise_error(Puppet::Error) + end + after do @class.clear @catalog.clear