X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fpin_spec.rb;h=f1ca43733b592be67de179393c80249ae2b43f9b;hb=7875745a8b5fe116df52f39c456e7b40c68c59a1;hp=7a58e78d1f18ef4fc6bd02e02a1576390f45e023;hpb=38c020867318ed9f34b63b6c36ca984e6385545e;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/pin_spec.rb b/spec/defines/pin_spec.rb index 7a58e78..f1ca437 100644 --- a/spec/defines/pin_spec.rb +++ b/spec/defines/pin_spec.rb @@ -1,5 +1,6 @@ require 'spec_helper' describe 'apt::pin', :type => :define do + let(:facts) { { :lsbdistid => 'Debian' } } let(:title) { 'my_pin' } let :default_params do @@ -12,21 +13,21 @@ describe 'apt::pin', :type => :define do } end - [ + [ { :params => {}, :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: release a=my_pin\nPin-Priority: 0\n" }, { :params => { - :packages => 'apache', + :packages => 'apache', :priority => '1' }, :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=my_pin\nPin-Priority: 1\n" }, { :params => { - :order => 50, - :packages => 'apache', + :order => 50, + :packages => 'apache', :priority => '1' }, :content => "# my_pin\nExplanation: : my_pin\nPackage: apache\nPin: release a=my_pin\nPin-Priority: 1\n" @@ -60,12 +61,12 @@ describe 'apt::pin', :type => :define do :priority => '1', :origin => 'ftp.de.debian.org' }, - :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: origin \"ftp.de.debian.org\"\nPin-Priority: 1\n" + :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: origin ftp.de.debian.org\nPin-Priority: 1\n" }, { :params => { :packages => 'apache', - :priority => '1', + :priority => '1', :release => 'stable', :codename => 'wheezy', :release_version => '3.0', @@ -75,6 +76,12 @@ describe 'apt::pin', :type => :define do }, :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" }, + { + :params => { + :packages => ['apache', 'ntop'], + }, + :content => "# my_pin\nExplanation: : my_pin\nPackage: apache ntop\nPin: release a=my_pin\nPin-Priority: 0\n" + }, ].each do |param_set| describe "when #{param_set == {} ? "using default" : "specifying"} define parameters" do let :param_hash do