File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 174
174
$pip_install = " ${pip_env} --log ${log} /pip.log install"
175
175
$pip_common_args = " ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source} "
176
176
177
- $pip_exec_name = " pip_install_${name} "
178
-
179
177
# Explicit version out of VCS when PIP supported URL is provided
180
178
if $source =~ /^' (git\+ |hg\+ |bzr\+ |svn\+ )(http|https|ssh|svn|sftp|ftp|lp|git)(:\/\/ ).+' $/ {
181
179
if $_ensure != present and $_ensure != latest {
221
219
222
220
default: {
223
221
# Anti-action, uninstall.
224
- $pip_exec_name = " pip_uninstall_${name} "
225
222
$command = " echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name} "
226
223
$unless_command = " ! ${pip_env} list | grep -i -e '${grep_regex} '"
227
224
}
228
225
}
229
226
}
230
227
231
- exec { $pip_exec_name:
228
+ $pip_installer = ($ensure == ' absent' ) ? {
229
+ true => " pip_uninstall_${name} " ,
230
+ false => " pip_install_${name} " ,
231
+ }
232
+
233
+ exec { $pip_installer:
232
234
command => $command ,
233
235
unless => $unless_command ,
234
236
user => $owner ,
Original file line number Diff line number Diff line change 106
106
it { is_expected . to contain_exec ( 'pip_install_rpyc' ) . with_unless ( %r{wordpress-json} ) }
107
107
end
108
108
end
109
+
110
+ describe 'uninstall' do
111
+ context 'adds correct title' do
112
+ let ( :params ) { { ensure : 'absent' } }
113
+
114
+ it { is_expected . not_to contain_exec ( 'pip_install_rpyc' ) }
115
+
116
+ it { is_expected . to contain_exec ( 'pip_uninstall_rpyc' ) . with_command ( %r{uninstall.*rpyc$} ) }
117
+ end
118
+ end
109
119
end
110
120
end
111
121
You can’t perform that action at this time.
0 commit comments