Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
apt_key now really works with userinfo for http(s)
[puppet-modules/puppetlabs-apt.git]
/
spec
/
unit
/
puppet
/
type
/
apt_key_spec.rb
diff --git
a/spec/unit/puppet/type/apt_key_spec.rb
b/spec/unit/puppet/type/apt_key_spec.rb
index e8a5462c6f3e91c002a208883fd4f3116344c66b..b17c8aed0ddb8056e704eacd557780f7eb671a95 100644
(file)
--- 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
: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
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
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
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
end
it 'content is not set' do
-
resource[:content].should
eq nil
+
expect(resource[:content]).to
eq nil
end
end
end
end
@@
-32,7
+32,7
@@
describe Puppet::Type::type(:apt_key) do
:id => '4bd6ec30'
)}
it 'id is set' do
:id => '4bd6ec30'
)}
it 'id is set' do
-
resource[:id].should
eq '4BD6EC30'
+
expect(resource[:id]).to
eq '4BD6EC30'
end
end
end
end
@@
-41,7
+41,7
@@
describe Puppet::Type::type(:apt_key) do
:id => 'FFFFFFFF4BD6EC30'
)}
it 'id is set' do
:id => 'FFFFFFFF4BD6EC30'
)}
it 'id is set' do
-
resource[:id].should
eq 'FFFFFFFF4BD6EC30'
+
expect(resource[:id]).to
eq 'FFFFFFFF4BD6EC30'
end
end
end
end
@@
-50,7
+50,7
@@
describe Puppet::Type::type(:apt_key) do
:id => '0x4BD6EC30'
)}
it 'id is set' do
:id => '0x4BD6EC30'
)}
it 'id is set' do
-
resource[:id].should
eq '4BD6EC30'
+
expect(resource[:id]).to
eq '4BD6EC30'
end
end
end
end
@@
-59,7
+59,7
@@
describe Puppet::Type::type(:apt_key) do
:id => '0x4bd6ec30'
)}
it 'id is set' do
:id => '0x4bd6ec30'
)}
it 'id is set' do
-
resource[:id].should
eq '4BD6EC30'
+
expect(resource[:id]).to
eq '4BD6EC30'
end
end
end
end
@@
-68,7
+68,7
@@
describe Puppet::Type::type(:apt_key) do
:id => '0xFFFFFFFF4BD6EC30'
)}
it 'id is set' do
:id => '0xFFFFFFFF4BD6EC30'
)}
it 'id is set' do
-
resource[:id].should
eq 'FFFFFFFF4BD6EC30'
+
expect(resource[:id]).to
eq 'FFFFFFFF4BD6EC30'
end
end
end
end
@@
-79,7
+79,7
@@
describe Puppet::Type::type(:apt_key) do
)}
it 'source is set to the URL' 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
end
end
@@
-90,7
+90,7
@@
describe Puppet::Type::type(:apt_key) do
)}
it 'content is set to the string' 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
end
end
@@
-101,7
+101,7
@@
describe Puppet::Type::type(:apt_key) do
)}
it 'keyserver is set to Debian' 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
end
end
@@
-136,6
+136,13
@@
describe Puppet::Type::type(:apt_key) do
)}.to_not raise_error
end
)}.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',
it 'allows the https URI scheme in source' do
expect { Puppet::Type.type(:apt_key).new(
:id => '4BD6EC30',