Merge pull request #64 from branan/rakefile_clean
[puppet-modules/puppetlabs-apt.git] / spec / classes / backports_spec.rb
1 require 'spec_helper'
2 describe 'apt::backports', :type => :class do
3
4   describe 'when turning on backports for ubuntu karmic' do
5
6     let :facts do
7       {
8         'lsbdistcodename' => 'Karmic',
9         'lsbdistid'       => 'Ubuntu'
10       }
11     end
12
13     it { should contain_apt__source('backports').with({
14         'location'   => 'http://old-releases.ubuntu.com/ubuntu',
15         'release'    => 'karmic-backports',
16         'repos'      => 'universe multiverse restricted',
17         'key'        => '437D05B5',
18         'key_server' => 'pgp.mit.edu',
19         'pin'        => '200',
20       })
21     }
22   end
23
24   describe "when turning on backports for debian squeeze" do
25
26     let :facts do
27       {
28         'lsbdistcodename' => 'Squeeze',
29         'lsbdistid'       => 'Debian',
30       }
31     end
32
33     it { should contain_apt__source('backports').with({
34         'location'   => 'http://backports.debian.org/debian-backports',
35         'release'    => 'squeeze-backports',
36         'repos'      => 'main contrib non-free',
37         'key'        => '55BE302B',
38         'key_server' => 'pgp.mit.edu',
39         'pin'        => '200',
40       })
41     }
42   end
43
44   describe "when turning on backports for debian squeeze but using your own mirror" do
45
46     let :facts do
47       {
48         'lsbdistcodename' => 'Squeeze',
49         'lsbdistid'       => 'Debian'
50       }
51     end
52
53     let :location do
54       'http://mirrors.example.com/debian-backports'
55     end
56
57     let :params do
58       { 'location' => location }
59     end
60
61     it { should contain_apt__source('backports').with({
62         'location'   => location,
63         'release'    => 'squeeze-backports',
64         'repos'      => 'main contrib non-free',
65         'key'        => '55BE302B',
66         'key_server' => 'pgp.mit.edu',
67         'pin'        => '200',
68       })
69     }
70   end
71 end