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 30
30
fail(' apt::setting cannot have both content and source' )
31
31
}
32
32
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
+ }
35
37
}
36
38
37
39
$title_array = split($title , ' -' )
Original file line number Diff line number Diff line change 143
143
it { is_expected . to contain_file ( '/etc/apt/apt.conf.d/100teddybear' ) . that_notifies ( 'Class[Apt::Update]' ) }
144
144
end
145
145
146
- describe 'with ensure=absent' do
146
+ describe 'with ensure=absent and default params ' do
147
147
let ( :params ) { default_params . merge ( ensure : 'absent' ) }
148
148
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
+
149
156
it {
150
157
expect ( subject ) . to contain_file ( '/etc/apt/apt.conf.d/50teddybear' ) . that_notifies ( 'Class[Apt::Update]' ) . with ( ensure : 'absent' )
151
158
}
You can’t perform that action at this time.
0 commit comments