mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Add force parameter to gem module (#51366)
This commit is contained in:
@@ -119,3 +119,22 @@ class TestGem(ModuleTestCase):
|
||||
|
||||
update_environ = run_command.call_args[1].get('environ_update', {})
|
||||
assert update_environ.get('GEM_HOME') == '/opt/dummy'
|
||||
|
||||
def test_passes_add_force_option(self):
|
||||
set_module_args({
|
||||
'name': 'dummy',
|
||||
'force': True,
|
||||
})
|
||||
|
||||
self.patch_rubygems_version()
|
||||
self.patch_installed_versions([])
|
||||
run_command = self.patch_run_command()
|
||||
|
||||
with pytest.raises(AnsibleExitJson) as exc:
|
||||
gem.main()
|
||||
|
||||
result = exc.value.args[0]
|
||||
assert result['changed']
|
||||
assert run_command.called
|
||||
|
||||
assert '--force' in get_command(run_command)
|
||||
|
||||
Reference in New Issue
Block a user