mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-17 17:31:31 +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:
parent
bd7b361db1
commit
6f12d93057
3 changed files with 114 additions and 122 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue