resource[:source].should eq 'http://apt.puppetlabs.com/pubkey.gpg'
end
end
-
+
context 'with content' do
let(:resource) { Puppet::Type.type(:apt_key).new(
:id => '4BD6EC30',
resource[:content].should eq 'http://apt.puppetlabs.com/pubkey.gpg'
end
end
-
+
context 'with keyserver' do
let(:resource) { Puppet::Type.type(:apt_key).new(
:id => '4BD6EC30',
)}.to_not raise_error
end
+ it 'allows the https URI with username and password' do
+ expect { Puppet::Type.type(:apt_key).new(
+ :id => '4BD6EC30',
+ :source => 'https://testme:Password2@pgp.mit.edu'
+ )}.to_not raise_error
+ end
+
it 'allows the ftp URI scheme in source' do
expect { Puppet::Type.type(:apt_key).new(
:id => '4BD6EC30',
:source => '/path/to/a/file'
)}.to_not raise_error
end
+
+ it 'allows 5-digit ports' do
+ expect { Puppet::Type.type(:apt_key).new(
+ :id => '4BD6EC30',
+ :source => 'http://pgp.mit.edu:12345/key'
+ )}.to_not raise_error
+ end
+
+ it 'allows 5-digit ports when using key servers' do
+ expect { Puppet::Type.type(:apt_key).new(
+ :id => '4BD6EC30',
+ :server => 'http://pgp.mit.edu:12345'
+ )}.to_not raise_error
+ end
end
end