Skip to content

Commit ace53d0

Browse files
committed
gem: Remove length chenck and adapt unit tests
1 parent 5794244 commit ace53d0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

plugins/modules/gem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def main():
335335
elif module.params['state'] == 'absent':
336336
if exists(module):
337337
command_output = uninstall(module)
338-
if command_output is not None and len(command_output) == 3 and exists(module):
338+
if command_output is not None and exists(module):
339339
rc, out, err = command_output
340340
module.fail_json(
341341
msg="Gem could not be removed",

tests/unit/plugins/modules/test_gem.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def new(module):
5252

5353
def patch_run_command(self):
5454
target = 'ansible.module_utils.basic.AnsibleModule.run_command'
55+
mock = self.mocker.patch(target)
56+
mock.return_value = (0, '', '')
5557
return self.mocker.patch(target)
5658

5759
def test_fails_when_user_install_and_install_dir_are_combined(self):

0 commit comments

Comments
 (0)