require 'spec_helper'
describe 'apt::hold' do
let :facts do {
- :osfamily => 'Debian',
- :lsbdistid => 'Debian',
- :lsbrelease => 'wheezy',
+ :osfamily => 'Debian',
+ :lsbdistid => 'Debian',
+ :lsbrelease => 'wheezy',
} end
let :title do
let :params do default_params end
it 'creates an apt preferences file' do
- should contain_apt__hold(title).with({
- :ensure => 'present',
- :package => title,
- :version => params[:version],
- :priority => 1001,
- })
-
- should contain_apt__pin("hold #{title} at #{params[:version]}").with({
+ should contain_apt__pin("hold_#{title}").with({
:ensure => 'present',
:packages => title,
:version => params[:version],
let :params do default_params.merge({:ensure => 'absent',}) end
it 'creates an apt preferences file' do
- should contain_apt__hold(title).with({
- :ensure => params[:ensure],
- })
- should contain_apt__pin("hold #{title} at #{params[:version]}").with({
+ should contain_apt__pin("hold_#{title}").with({
:ensure => params[:ensure],
})
end
let :params do default_params.merge({:priority => 990,}) end
it 'creates an apt preferences file' do
- should contain_apt__hold(title).with({
+ should contain_apt__pin("hold_#{title}").with({
:ensure => 'present',
- :package => title,
+ :packages => title,
:version => params[:version],
:priority => params[:priority],
})
+ end
+ end
- should contain_apt__pin("hold #{title} at #{params[:version]}").with({
+ describe 'package => foo' do
+ let :params do default_params.merge({:package => 'foo'}) end
+
+ it 'creates an apt preferences file' do
+ should contain_apt__pin("hold_foo").with({
:ensure => 'present',
- :packages => title,
+ :packages => 'foo',
:version => params[:version],
- :priority => params[:priority],
+ :priority => 1001,
})
end
end
+
describe 'validation' do
context 'version => {}' do
let :params do { :version => {}, } end