require 'spec_helper'
describe 'apt::source', type: :define do
- GPG_KEY_ID = '6F6B15509CF8E59E6E469F327F438280EF8D349F'
-
- let :title do
- 'my_source'
- end
-
+ let(:id) { '6F6B15509CF8E59E6E469F327F438280EF8D349F' }
+ let(:title) { 'my_source' }
let :facts do
{
os: {
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
- },
+ id: 'Debian'
+ }
+ }
}
end
let :params do
{
'include' => { 'deb' => false, 'src' => true },
- 'location' => 'http://debian.mirror.iweb.ca/debian/',
+ 'location' => 'http://debian.mirror.iweb.ca/debian/'
}
end
'release' => 'sid',
'repos' => 'testing',
'include' => { 'src' => false },
- 'key' => GPG_KEY_ID,
+ 'key' => id,
'pin' => '10',
'architecture' => 'x86_64',
- 'allow_unsigned' => true,
+ 'allow_unsigned' => true
}
end
}
it {
- expect(subject).to contain_apt__key("Add key: #{GPG_KEY_ID} from Apt::Source my_source").that_comes_before('Apt::Setting[list-my_source]').with('ensure' => 'present',
- 'id' => GPG_KEY_ID)
+ expect(subject).to contain_apt__key("Add key: #{id} from Apt::Source my_source").that_comes_before('Apt::Setting[list-my_source]').with('ensure' => 'present',
+ 'id' => id)
}
end
{
'include' => { 'src' => false },
'location' => 'http://debian.mirror.iweb.ca/debian/',
- 'allow_insecure' => true,
+ 'allow_insecure' => true
}
end
{
'include' => { 'src' => false },
'location' => 'http://debian.mirror.iweb.ca/debian/',
- 'allow_unsigned' => true,
+ 'allow_unsigned' => true
}
end
let :params do
{
'location' => 'http://debian.mirror.iweb.ca/debian/',
- 'architecture' => 'x86_64',
+ 'architecture' => 'x86_64'
}
end
context 'with ensure => absent' do
let :params do
{
- 'ensure' => 'absent',
+ 'ensure' => 'absent'
}
end
name: 'Debian',
release: {
major: '8',
- full: '8.0',
+ full: '8.0'
},
distro: {
- id: 'Debian',
- },
- },
+ id: 'Debian'
+ }
+ }
}
end