File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 3030 fail(' apt::setting cannot have both content and source' )
3131 }
3232
33- if !$content and !$source {
34- fail(' apt::setting needs either of content or source' )
33+ if $ensure != ' absent' {
34+ if !$content and !$source {
35+ fail(' apt::setting needs either of content or source' )
36+ }
3537 }
3638
3739 $title_array = split($title , ' -' )
Original file line number Diff line number Diff line change 143143 it { is_expected . to contain_file ( '/etc/apt/apt.conf.d/100teddybear' ) . that_notifies ( 'Class[Apt::Update]' ) }
144144 end
145145
146- describe 'with ensure=absent' do
146+ describe 'with ensure=absent and default params ' do
147147 let ( :params ) { default_params . merge ( ensure : 'absent' ) }
148148
149+ it {
150+ expect ( subject ) . to contain_file ( '/etc/apt/apt.conf.d/50teddybear' ) . that_notifies ( 'Class[Apt::Update]' ) . with ( ensure : 'absent' )
151+ }
152+ end
153+ describe 'with ensure=absent and without default params' do
154+ let ( :params ) { { ensure : 'absent' } }
155+
149156 it {
150157 expect ( subject ) . to contain_file ( '/etc/apt/apt.conf.d/50teddybear' ) . that_notifies ( 'Class[Apt::Update]' ) . with ( ensure : 'absent' )
151158 }
You can’t perform that action at this time.
0 commit comments