X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fpin_spec.rb;h=4f51cf3d715c181bb41b7ebc274faa937fc8376c;hb=6cb399a281d9f07ee29508cbc2ec4c8cabfe3fa7;hp=7ae41a9cba32fab74c5ece9db6ea8a3d17dad649;hpb=21a2462a58938d126b66985c0b0fa1f8e09f27cd;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/pin_spec.rb b/spec/defines/pin_spec.rb index 7ae41a9..4f51cf3 100644 --- a/spec/defines/pin_spec.rb +++ b/spec/defines/pin_spec.rb @@ -3,23 +3,27 @@ describe 'apt::pin', :type => :define do let :pre_condition do 'class { "apt": }' end - let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :puppetversion => '3.5.0', } } + let(:facts) { { + :os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }}, + :lsbdistid => 'Debian', + :osfamily => 'Debian', + :lsbdistcodename => 'wheezy', + :puppetversion => Puppet.version, + } } let(:title) { 'my_pin' } context 'defaults' do it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: : my_pin\nPackage: \*\nPin: release a=my_pin\nPin-Priority: 0\n/)} - it { is_expected.to contain_apt__setting("pref-my_pin") } end context 'set version' do let :params do { 'packages' => 'vim', - 'version' => '1', + 'version' => "1", } end it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: : my_pin\nPackage: vim\nPin: version 1\nPin-Priority: 0\n/)} - it { is_expected.to contain_apt__setting("pref-my_pin") } end context 'set origin' do @@ -30,7 +34,6 @@ describe 'apt::pin', :type => :define do } end it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: : my_pin\nPackage: vim\nPin: origin test\nPin-Priority: 0\n/)} - it { is_expected.to contain_apt__setting("pref-my_pin") } end context 'not defaults' do @@ -81,7 +84,7 @@ describe 'apt::pin', :type => :define do it do expect { subject.call - }.to raise_error(Puppet::Error, /Only integers are allowed/) + }.to raise_error(Puppet::Error, /expects a value of type Integer/) end end