X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fsource_spec.rb;h=79cc11b990d782ec58ef7f9e84a4c352a3ce0e3d;hb=61f4e6aee2dc2a031e5ce8b8e97b55456c4e00a8;hp=5b37446f27095a737ce5420e4aeb0a9ef1ffc3ed;hpb=4815fa1f5482814e1d1a7e1626277aa35e3fc67c;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 5b37446..79cc11b 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -237,6 +237,30 @@ describe 'apt::source' do } end + context 'with architecture fact and unset architecture parameter' do + let :facts do + { + :architecture => 'amd64', + :os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }}, + :lsbdistid => 'Debian', + :lsbdistcodename => 'wheezy', + :osfamily => 'Debian', + :puppetversion => Puppet.version, + } + end + let :params do + { + :location => 'hello.there', + :include => {'deb' => false, 'src' => true,}, + } + end + + it { is_expected.to contain_apt__setting('list-my_source').with({ + :ensure => 'present', + }).with_content(/# my_source\ndeb-src hello.there wheezy main\n/) + } + end + context 'include_src => true' do let :facts do { @@ -349,6 +373,20 @@ describe 'apt::source' do end end + context 'release is empty string' do + let :facts do + { + :os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }}, + :lsbdistid => 'Debian', + :osfamily => 'Debian', + :puppetversion => Puppet.version, + } + end + let(:params) { { :location => 'hello.there', :release => '' } } + + it { is_expected.to contain_apt__setting('list-my_source').with_content(/hello\.there main/) } + end + context 'invalid pin' do let :facts do {