mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Add support for pre_releases argument to the gem state
This commit is contained in:
parent
84d8e71a00
commit
4549ef25a2
@ -32,7 +32,8 @@ def installed(name, # pylint: disable=C0103
|
||||
user=None,
|
||||
version=None,
|
||||
rdoc=False,
|
||||
ri=False): # pylint: disable=C0103
|
||||
ri=False,
|
||||
pre_releases=False): # pylint: disable=C0103
|
||||
'''
|
||||
Make sure that a gem is installed.
|
||||
|
||||
@ -61,6 +62,9 @@ def installed(name, # pylint: disable=C0103
|
||||
|
||||
ri : False
|
||||
Generate RI documentation for the gem(s).
|
||||
|
||||
pre_releases : False
|
||||
Install pre-release version of gem(s) if available.
|
||||
'''
|
||||
ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
|
||||
|
||||
@ -106,7 +110,8 @@ def installed(name, # pylint: disable=C0103
|
||||
runas=user,
|
||||
version=version,
|
||||
rdoc=rdoc,
|
||||
ri=ri):
|
||||
ri=ri,
|
||||
pre_releases=pre_releases):
|
||||
ret['result'] = True
|
||||
ret['changes'][name] = 'Installed'
|
||||
ret['comment'] = 'Gem was successfully installed'
|
||||
|
@ -29,8 +29,8 @@ class TestGemState(TestCase):
|
||||
ret = gem.installed('quux')
|
||||
self.assertEqual(True, ret['result'])
|
||||
gem_install_succeeds.assert_called_once_with(
|
||||
'quux', ruby=None, runas=None, version=None, rdoc=False,
|
||||
ri=False
|
||||
'quux', pre_releases=False, ruby=None, runas=None,
|
||||
version=None, rdoc=False, ri=False
|
||||
)
|
||||
|
||||
with patch.dict(gem.__salt__,
|
||||
@ -38,8 +38,8 @@ class TestGemState(TestCase):
|
||||
ret = gem.installed('quux')
|
||||
self.assertEqual(False, ret['result'])
|
||||
gem_install_fails.assert_called_once_with(
|
||||
'quux', ruby=None, runas=None, version=None, rdoc=False,
|
||||
ri=False
|
||||
'quux', pre_releases=False, ruby=None, runas=None,
|
||||
version=None, rdoc=False, ri=False
|
||||
)
|
||||
|
||||
def test_removed(self):
|
||||
|
Loading…
Reference in New Issue
Block a user