2 describe 'apt::pin', :type => :define do
3 let(:facts) { { :lsbdistid => 'Debian' } }
4 let(:title) { 'my_pin' }
18 :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: release a=my_pin\nPin-Priority: 0\n"
22 :packages => 'apache',
25 :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=my_pin\nPin-Priority: 1\n"
30 :packages => 'apache',
33 :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=my_pin\nPin-Priority: 1\n"
38 :packages => 'apache',
41 :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=my_pin\nPin-Priority: 1\n"
45 :packages => 'apache',
47 :release => 'my_newpin'
49 :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=my_newpin\nPin-Priority: 1\n"
53 :packages => 'apache',
57 :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: version 2.2.16*\nPin-Priority: 1\n"
62 :origin => 'ftp.de.debian.org'
64 :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: origin ftp.de.debian.org\nPin-Priority: 1\n"
68 :packages => 'apache',
71 :codename => 'wheezy',
72 :release_version => '3.0',
74 :originator => 'Debian',
77 :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=stable, n=wheezy, v=3.0, c=main, o=Debian, l=Debian\nPin-Priority: 1\n"
80 describe "when #{param_set == {} ? "using default" : "specifying"} define parameters" do
82 default_params.merge(param_set[:params])
89 it { should contain_class("apt::params") }
91 it { should contain_file("#{title}.pref").with({
92 'ensure' => param_hash[:ensure],
93 'path' => "/etc/apt/preferences.d/#{param_hash[:order] == '' ? "" : "#{param_hash[:order]}-"}#{title}.pref",
97 'content' => param_set[:content],