aboutsummaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorLuchi <39198766+luchihoratiu@users.noreply.github.com>2020-03-10 11:56:24 +0200
committerGitHub <noreply@github.com>2020-03-10 11:56:24 +0200
commit4732c3f7cac68b7376b579c1390d0f2fc57300d0 (patch)
tree8309796c9485c084ec87cd84d26d17ecfb904213 /spec/unit
parent9f710d8e502b5bf2ca3d213d2bddea13f7a4b7b8 (diff)
parent92a734a6620fcc51691d60347e344f87ac801bde (diff)
downloadpuppet-sshkeys_core-4732c3f7cac68b7376b579c1390d0f2fc57300d0.tar.gz
puppet-sshkeys_core-4732c3f7cac68b7376b579c1390d0f2fc57300d0.tar.bz2
Merge pull request #27 from ciprianbadescu/MODULES-7613/use_composite_namevars
(MODULES-7613) use name and type as composite namevar
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/type/sshkey_spec.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/unit/type/sshkey_spec.rb b/spec/unit/type/sshkey_spec.rb
index 452610e..680d9ec 100644
--- a/spec/unit/type/sshkey_spec.rb
+++ b/spec/unit/type/sshkey_spec.rb
@@ -1,18 +1,19 @@
require 'spec_helper'
+require 'pry'
describe Puppet::Type.type(:sshkey) do
- it 'uses :name as its namevar' do
- expect(described_class.key_attributes).to eq [:name]
+ it 'uses :name and :type as its namevar' do
+ expect(described_class.key_attributes).to eq [:type, :name]
end
describe 'when validating attributes' do
- [:name, :provider].each do |param|
+ [:name, :provider, :type].each do |param|
it "has a #{param} parameter" do
expect(described_class.attrtype(param)).to eq :param
end
end
- [:host_aliases, :ensure, :key, :type].each do |property|
+ [:host_aliases, :ensure, :key].each do |property|
it "has a #{property} property" do
expect(described_class.attrtype(property)).to eq :property
end
@@ -35,12 +36,12 @@ describe Puppet::Type.type(:sshkey) do
it 'aliases :rsa to :ssh-rsa' do
key = described_class.new(name: 'foo', type: :rsa)
- expect(key.should(:type)).to eq :'ssh-rsa'
+ expect(key.parameter(:type).value).to eq :'ssh-rsa'
end
it 'aliases :dsa to :ssh-dss' do
key = described_class.new(name: 'foo', type: :dsa)
- expect(key.should(:type)).to eq :'ssh-dss'
+ expect(key.parameter(:type).value).to eq :'ssh-dss'
end
it "doesn't support values other than ssh-dss, ssh-rsa, dsa, rsa for type" do