summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider')
-rwxr-xr-xspec/unit/provider/ssh_authorized_key/parsed.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/provider/ssh_authorized_key/parsed.rb b/spec/unit/provider/ssh_authorized_key/parsed.rb
index 0edf2b0ae..f8613e35e 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed.rb
@@ -204,5 +204,17 @@ describe provider_class do
proc { @provider.flush }.should raise_error
end
end
+
+ describe "and a invalid user has been specified with no target" do
+ before :each do
+ @resource.stubs(:should).with(:user).returns "thisusershouldnotexist"
+ @resource.stubs(:should).with(:target).returns nil
+ end
+
+ it "should catch an exception and raise a Puppet error" do
+ lambda { @provider.flush }.should raise_error(Puppet::Error)
+ end
+ end
+
end
end