X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Fpuppet%2Ftype%2Fapt_key_spec.rb;h=b17c8aed0ddb8056e704eacd557780f7eb671a95;hb=249a6d586279ab96ffa8f645dcdd0e44210fd4e6;hp=e8a5462c6f3e91c002a208883fd4f3116344c66b;hpb=95bed8902f31bf84947c4951872f712b3cbd6741;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/unit/puppet/type/apt_key_spec.rb b/spec/unit/puppet/type/apt_key_spec.rb index e8a5462..b17c8ae 100644 --- a/spec/unit/puppet/type/apt_key_spec.rb +++ b/spec/unit/puppet/type/apt_key_spec.rb @@ -7,23 +7,23 @@ describe Puppet::Type::type(:apt_key) do :id => '4BD6EC30' )} it 'id is set' do - resource[:id].should eq '4BD6EC30' + expect(resource[:id]).to eq '4BD6EC30' end it 'name is set to id' do - resource[:name].should eq '4BD6EC30' + expect(resource[:name]).to eq '4BD6EC30' end it 'keyserver is default' do - resource[:server].should eq :'keyserver.ubuntu.com' + expect(resource[:server]).to eq :'keyserver.ubuntu.com' end it 'source is not set' do - resource[:source].should eq nil + expect(resource[:source]).to eq nil end it 'content is not set' do - resource[:content].should eq nil + expect(resource[:content]).to eq nil end end @@ -32,7 +32,7 @@ describe Puppet::Type::type(:apt_key) do :id => '4bd6ec30' )} it 'id is set' do - resource[:id].should eq '4BD6EC30' + expect(resource[:id]).to eq '4BD6EC30' end end @@ -41,7 +41,7 @@ describe Puppet::Type::type(:apt_key) do :id => 'FFFFFFFF4BD6EC30' )} it 'id is set' do - resource[:id].should eq 'FFFFFFFF4BD6EC30' + expect(resource[:id]).to eq 'FFFFFFFF4BD6EC30' end end @@ -50,7 +50,7 @@ describe Puppet::Type::type(:apt_key) do :id => '0x4BD6EC30' )} it 'id is set' do - resource[:id].should eq '4BD6EC30' + expect(resource[:id]).to eq '4BD6EC30' end end @@ -59,7 +59,7 @@ describe Puppet::Type::type(:apt_key) do :id => '0x4bd6ec30' )} it 'id is set' do - resource[:id].should eq '4BD6EC30' + expect(resource[:id]).to eq '4BD6EC30' end end @@ -68,7 +68,7 @@ describe Puppet::Type::type(:apt_key) do :id => '0xFFFFFFFF4BD6EC30' )} it 'id is set' do - resource[:id].should eq 'FFFFFFFF4BD6EC30' + expect(resource[:id]).to eq 'FFFFFFFF4BD6EC30' end end @@ -79,7 +79,7 @@ describe Puppet::Type::type(:apt_key) do )} it 'source is set to the URL' do - resource[:source].should eq 'http://apt.puppetlabs.com/pubkey.gpg' + expect(resource[:source]).to eq 'http://apt.puppetlabs.com/pubkey.gpg' end end @@ -90,7 +90,7 @@ describe Puppet::Type::type(:apt_key) do )} it 'content is set to the string' do - resource[:content].should eq 'http://apt.puppetlabs.com/pubkey.gpg' + expect(resource[:content]).to eq 'http://apt.puppetlabs.com/pubkey.gpg' end end @@ -101,7 +101,7 @@ describe Puppet::Type::type(:apt_key) do )} it 'keyserver is set to Debian' do - resource[:server].should eq 'http://keyring.debian.org' + expect(resource[:server]).to eq 'http://keyring.debian.org' end end @@ -136,6 +136,13 @@ describe Puppet::Type::type(:apt_key) do )}.to_not raise_error end + it 'allows the http URI with username and password' do + expect { Puppet::Type.type(:apt_key).new( + :id => '4BD6EC30', + :source => 'http://testme:Password2@pgp.mit.edu' + )}.to_not raise_error + end + it 'allows the https URI scheme in source' do expect { Puppet::Type.type(:apt_key).new( :id => '4BD6EC30',