'class { "apt": }'
end
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :puppetversion => Puppet.version, } }
- GPG_KEY_ID = '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30'
+ GPG_KEY_ID = '6F6B15509CF8E59E6E469F327F438280EF8D349F'
let :title do
GPG_KEY_ID
:server => '-pgp.mit.edu',
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject.call } .to raise_error(/does not match/)
end
end
:server => '.pgp.mit.edu',
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject.call } .to raise_error(/does not match/)
end
end
:server => "pgp.mit.edu.",
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject.call } .to raise_error(/does not match/)
end
end
context "exceed character url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "incorrect port number url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "incorrect protocol for url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "missing port number url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "url ending with a dot" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "url begin with a dash" do
:server => "hkp://-pgp.mit.edu",
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context 'invalid key' do
'Out of rum. Why? Why are we out of rum?'
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
:source => 'afp://puppetlabs.com/key.gpg',
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
:content => [],
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject.call }.to raise_error(/is not a string/)
end
end
:server => 'two bottles of rum',
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
:options => {},
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject.call }.to raise_error(/is not a string/)
end
end
context 'invalid ensure' do
- let :params do
- {
- :ensure => 'foo',
- }
- end
- it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ %w(foo aabsent absenta apresent presenta).each do |param|
+ let :params do
+ {
+ :ensure => param,
+ }
+ end
+ it 'fails' do
+ expect { subject.call }.to raise_error(/does not match/)
+ end
end
end
apt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
end
it 'informs the user of the impossibility' do
- expect { subject }.to raise_error(/already ensured as absent/)
+ expect { subject.call }.to raise_error(/already ensured as absent/)
end
end
end