X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fapt_backports_spec.rb;h=5762025eaff44ad5002bc3d58e7ad983f4589084;hb=89c747ab3b2caad9b36b8ce53a693537f4db6f36;hp=b9077a6bcd67775a51907f0cb77243f8acf2a7ee;hpb=044fb5faf545f1336c949bd5667da3d5dda2fa1f;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/apt_backports_spec.rb b/spec/classes/apt_backports_spec.rb index b9077a6..5762025 100644 --- a/spec/classes/apt_backports_spec.rb +++ b/spec/classes/apt_backports_spec.rb @@ -10,14 +10,15 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', + :puppetversion => Puppet.version, } end it { is_expected.to contain_apt__source('backports').with({ - :location => 'http://ftp.debian.org/debian/', + :location => 'http://httpredir.debian.org/debian', :key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', :repos => 'main contrib non-free', :release => 'wheezy-backports', - :pin => 200, + :pin => { 'priority' => 200, 'release' => 'wheezy-backports' }, }) } end @@ -27,14 +28,15 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'squeeze', + :puppetversion => Puppet.version, } end it { is_expected.to contain_apt__source('backports').with({ - :location => 'http://backports.debian.org/debian-backports', + :location => 'http://httpredir.debian.org/debian-backports', :key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', :repos => 'main contrib non-free', :release => 'squeeze-backports', - :pin => 200, + :pin => { 'priority' => 200, 'release' => 'squeeze-backports' }, }) } end @@ -44,6 +46,8 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', + :puppetversion => Puppet.version, } end it { is_expected.to contain_apt__source('backports').with({ @@ -51,7 +55,7 @@ describe 'apt::backports', :type => :class do :key => '630239CC130E1A7FD81A27B140976EAF437D05B5', :repos => 'main universe multiverse restricted', :release => 'trusty-backports', - :pin => 200, + :pin => { 'priority' => 200, 'release' => 'trusty-backports' }, }) } end @@ -61,6 +65,8 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', + :puppetversion => Puppet.version, } end let(:params) do @@ -77,7 +83,7 @@ describe 'apt::backports', :type => :class do :key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', :repos => 'main', :release => 'vivid', - :pin => 90, + :pin => { 'priority' => 90, 'release' => 'vivid' }, }) } end @@ -87,6 +93,8 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', + :puppetversion => Puppet.version, } end let(:params) do @@ -112,6 +120,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'linuxmint', :osfamily => 'Debian', :lsbdistcodename => 'qiana', + :puppetversion => Puppet.version, } end context 'sets all the needed things' do @@ -128,7 +137,7 @@ describe 'apt::backports', :type => :class do :key => '630239CC130E1A7FD81A27B140976EAF437D05B5', :repos => 'main universe multiverse restricted', :release => 'trusty-backports', - :pin => 200, + :pin => { 'priority' => 200, 'release' => 'trusty-backports' }, }) } end @@ -142,7 +151,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/) end end @@ -156,7 +165,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/) end end @@ -170,7 +179,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/) end end @@ -184,7 +193,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/) end end @@ -195,6 +204,8 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', + :puppetversion => Puppet.version, } end context 'invalid location' do @@ -205,7 +216,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /is not a string/) end end @@ -217,7 +228,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /is not a string/) end end @@ -229,7 +240,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /is not a string/) end end @@ -241,7 +252,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /is not a string/) end end @@ -253,7 +264,7 @@ describe 'apt::backports', :type => :class do end it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /pin must be either a string, number or hash/) end end