29
29
describe "when validating values" do
31
it "should support ssh-dss as a type value" do
32
proc { @class.new(:name => "foo", :type => "ssh-dss") }.should_not raise_error
35
it "should support ssh-rsa as a type value" do
36
proc { @class.new(:name => "whev", :type => "ssh-rsa") }.should_not raise_error
39
it "should alias :dsa to ssh-dss as a value for type" do
40
key = @class.new(:name => "whev", :type => :dsa)
31
[:'ssh-dss', :'ssh-rsa', :rsa, :dsa, :'ecdsa-sha2-nistp256', :'ecdsa-sha2-nistp384', :'ecdsa-sha2-nistp521'].each do |keytype|
32
it "should support #{keytype} as a type value" do
33
proc { @class.new(:name => "foo", :type => keytype) }.should_not raise_error
37
it "should alias :rsa to :ssh-rsa" do
38
key = @class.new(:name => "foo", :type => :rsa)
39
key.should(:type).should == :'ssh-rsa'
42
it "should alias :dsa to :ssh-dss" do
43
key = @class.new(:name => "foo", :type => :dsa)
41
44
key.should(:type).should == :'ssh-dss'
44
it "should alias :rsa to ssh-rsa as a value for type" do
45
key = @class.new(:name => "whev", :type => :rsa)
46
key.should(:type).should == :'ssh-rsa'
49
47
it "should not support values other than ssh-dss, ssh-rsa, dsa, rsa for type" do
50
48
proc { @class.new(:name => "whev", :type => :'ssh-dsa') }.should raise_error(Puppet::Error)