File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 174174 $pip_install = " ${pip_env} --log ${log} /pip.log install"
175175 $pip_common_args = " ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source} "
176176
177- $pip_exec_name = " pip_install_${name} "
178-
179177 # Explicit version out of VCS when PIP supported URL is provided
180178 if $source =~ /^' (git\+ |hg\+ |bzr\+ |svn\+ )(http|https|ssh|svn|sftp|ftp|lp|git)(:\/\/ ).+' $/ {
181179 if $_ensure != present and $_ensure != latest {
221219
222220 default: {
223221 # Anti-action, uninstall.
224- $pip_exec_name = " pip_uninstall_${name} "
225222 $command = " echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name} "
226223 $unless_command = " ! ${pip_env} list | grep -i -e '${grep_regex} '"
227224 }
228225 }
229226 }
230227
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:
232234 command => $command ,
233235 unless => $unless_command ,
234236 user => $owner ,
Original file line number Diff line number Diff line change 106106 it { is_expected . to contain_exec ( 'pip_install_rpyc' ) . with_unless ( %r{wordpress-json} ) }
107107 end
108108 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
109119 end
110120end
111121
You can’t perform that action at this time.
0 commit comments