1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-18 01:41:35 +00:00

gem: use CmdRunner (#11733)

* gem: use `CmdRunner`

* add changelog frag

* gem: restore get_rubygems_path() helper to preserve executable splitting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky 2026-04-12 23:12:26 +12:00 committed by GitHub
parent bd7b361db1
commit 6f12d93057
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 114 additions and 122 deletions

View file

@ -3,8 +3,6 @@
# SPDX-License-Identifier: MIT
from __future__ import annotations
import copy
import pytest
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import (
AnsibleExitJson,
@ -26,10 +24,9 @@ def get_command(run_command):
class TestGem(ModuleTestCase):
def setUp(self):
super().setUp()
self.rubygems_path = ["/usr/bin/gem"]
self.mocker.patch(
"ansible_collections.community.general.plugins.modules.gem.get_rubygems_path",
lambda module: copy.deepcopy(self.rubygems_path),
"ansible.module_utils.basic.AnsibleModule.get_bin_path",
return_value="/usr/bin/gem",
)
@pytest.fixture(autouse=True)
@ -41,7 +38,7 @@ class TestGem(ModuleTestCase):
target = "ansible_collections.community.general.plugins.modules.gem.get_installed_versions"
def new(module, remote=False):
def new(runner, remote=False):
return versions
return self.mocker.patch(target, new)