describe 'normal operation' do
describe 'default options' do
it {
- is_expected.to contain_apt_key(title).with(id: title,
- ensure: 'present',
- source: nil,
- server: 'keyserver.ubuntu.com',
- content: nil)
+ expect(subject).to contain_apt_key(title).with(id: title,
+ ensure: 'present',
+ source: nil,
+ server: 'keyserver.ubuntu.com',
+ content: nil)
}
it 'contains the apt_key present anchor' do
- is_expected.to contain_anchor("apt_key #{title} present")
+ expect(subject).to contain_anchor("apt_key #{title} present")
end
end
end
it 'contains the apt_key' do
- is_expected.to contain_apt_key(title).with(id: GPG_KEY_ID,
- ensure: 'present',
- source: nil,
- server: 'keyserver.ubuntu.com',
- content: nil)
+ expect(subject).to contain_apt_key(title).with(id: GPG_KEY_ID,
+ ensure: 'present',
+ source: nil,
+ server: 'keyserver.ubuntu.com',
+ content: nil)
end
it 'contains the apt_key present anchor' do
- is_expected.to contain_anchor("apt_key #{GPG_KEY_ID} present")
+ expect(subject).to contain_anchor("apt_key #{GPG_KEY_ID} present")
end
end
end
it 'contains the apt_key' do
- is_expected.to contain_apt_key(title).with(id: title,
- ensure: 'absent',
- source: nil,
- server: 'keyserver.ubuntu.com',
- content: nil)
+ expect(subject).to contain_apt_key(title).with(id: title,
+ ensure: 'absent',
+ source: nil,
+ server: 'keyserver.ubuntu.com',
+ content: nil)
end
it 'contains the apt_key absent anchor' do
- is_expected.to contain_anchor("apt_key #{title} absent")
+ expect(subject).to contain_anchor("apt_key #{title} absent")
end
end
end
it 'contains the apt_key' do
- is_expected.to contain_apt_key(title).with(contains_apt_key_example(title))
+ expect(subject).to contain_apt_key(title).with(contains_apt_key_example(title))
end
it 'contains the apt_key present anchor' do
- is_expected.to contain_anchor("apt_key #{title} present")
+ expect(subject).to contain_anchor("apt_key #{title} present")
end
end
end
it 'contains the apt_key' do
- is_expected.to contain_apt_key(title).with(id: title,
- server: 'p-gp.m-it.edu')
+ expect(subject).to contain_apt_key(title).with(id: title,
+ server: 'p-gp.m-it.edu')
end
end
end
it 'contains the apt_key' do
- is_expected.to contain_apt_key(title).with(id: title,
- server: 'hkp://pgp.mit.edu')
+ expect(subject).to contain_apt_key(title).with(id: title,
+ server: 'hkp://pgp.mit.edu')
end
end
end
it 'contains the apt_key' do
- is_expected.to contain_apt_key(title).with(id: title,
- server: 'hkp://pgp.mit.edu:80')
+ expect(subject).to contain_apt_key(title).with(id: title,
+ server: 'hkp://pgp.mit.edu:80')
end
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
- context 'with incorrect protocol for url' do
+ context 'with incorrect protocol for url' do
let :params do
{
server: 'abc://pgp.mit.edu:80',
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{evaluating a Resource})
+ expect(subject).to raise_error(%r{evaluating a Resource})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a})
+ expect(subject).to raise_error(%r{expects a})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a match})
+ expect(subject).to raise_error(%r{expects a match})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{expects a})
+ expect(subject).to raise_error(%r{expects a})
end
end
end
it 'fails' do
- is_expected.to raise_error(%r{Enum\['absent', 'present', 'refreshed'\]})
+ expect(subject).to raise_error(%r{Enum\['absent', 'present', 'refreshed'\]})
end
end
end
it 'contains the duplicate apt::key resource' do
- is_expected.to contain_apt__key('duplicate').with(id: title,
- ensure: 'present')
+ expect(subject).to contain_apt__key('duplicate').with(id: title,
+ ensure: 'present')
end
it 'contains the original apt::key resource' do
- is_expected.to contain_apt__key(title).with(id: title,
- ensure: 'present')
+ expect(subject).to contain_apt__key(title).with(id: title,
+ ensure: 'present')
end
it 'contains the native apt_key' do
- is_expected.to contain_apt_key('duplicate').with(apt_key_example(title))
+ expect(subject).to contain_apt_key('duplicate').with(apt_key_example(title))
end
it 'does not contain the original apt_key' do
- is_expected.not_to contain_apt_key(title)
+ expect(subject).not_to contain_apt_key(title)
end
end
end
it 'informs the user of the impossibility' do
- is_expected.to raise_error(%r{already ensured as absent})
+ expect(subject).to raise_error(%r{already ensured as absent})
end
end
end