mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Added testcases to suppor rbevn in gem.
This commit is contained in:
parent
8cb168f612
commit
2e1db23b15
@ -17,6 +17,7 @@ class TestGemModule(TestCase):
|
||||
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
with patch.dict(gem.__salt__,
|
||||
{'rvm.is_installed': MagicMock(return_value=False),
|
||||
'rbenv.is_installed': MagicMock(return_value=False),
|
||||
'cmd.run_all': mock}):
|
||||
gem._gem('install rails')
|
||||
mock.assert_called_once_with('gem install rails', runas=None)
|
||||
@ -24,12 +25,23 @@ class TestGemModule(TestCase):
|
||||
mock = MagicMock(return_value=None)
|
||||
with patch.dict(gem.__salt__,
|
||||
{'rvm.is_installed': MagicMock(return_value=True),
|
||||
'rbenv.is_installed': MagicMock(return_value=False),
|
||||
'rvm.do': mock}):
|
||||
gem._gem('install rails', ruby='1.9.3')
|
||||
mock.assert_called_once_with(
|
||||
'1.9.3', 'gem install rails', runas=None
|
||||
)
|
||||
|
||||
mock = MagicMock(return_value=None)
|
||||
with patch.dict(gem.__salt__,
|
||||
{'rvm.is_installed': MagicMock(return_value=False),
|
||||
'rbenv.is_installed': MagicMock(return_value=True),
|
||||
'rbenv.do': mock}):
|
||||
gem._gem('install rails')
|
||||
mock.assert_called_once_with(
|
||||
'gem install rails', runas=None
|
||||
)
|
||||
|
||||
def test_list(self):
|
||||
output = '''
|
||||
actionmailer (2.3.14)
|
||||
|
Loading…
Reference in New Issue
Block a user