X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fapt_backports_spec.rb;h=496fec0cdf532271d864d6d8117bfe00393bd428;hb=9f43b2db2655e216035c129b1031b225c83a6030;hp=b9077a6bcd67775a51907f0cb77243f8acf2a7ee;hpb=33c296b963a433c6fe5584b0fd1148c7330c69d0;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/apt_backports_spec.rb b/spec/classes/apt_backports_spec.rb index b9077a6..496fec0 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,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :puppetversion => Puppet.version, } end it { is_expected.to contain_apt__source('backports').with({ @@ -51,7 +54,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 +64,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :puppetversion => Puppet.version, } end let(:params) do @@ -77,7 +81,7 @@ describe 'apt::backports', :type => :class do :key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', :repos => 'main', :release => 'vivid', - :pin => 90, + :pin => { 'priority' => 90, 'release' => 'vivid' }, }) } end @@ -87,6 +91,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :puppetversion => Puppet.version, } end let(:params) do @@ -112,6 +117,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 +134,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 +148,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 +162,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 +176,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 +190,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 +201,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :puppetversion => Puppet.version, } end context 'invalid location' do @@ -205,7 +212,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 +224,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 +236,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 +248,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 +260,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