def test__check_and_install_ruby(): mock_check_rvm = MagicMock(return_value={"changes": {}, "result": True}) mock_check_ruby = MagicMock(return_value={"changes": {}, "result": False}) mock_install_ruby = MagicMock(return_value="") with patch.object(rvm, "_check_rvm", new=mock_check_rvm): with patch.object(rvm, "_check_ruby", new=mock_check_ruby): with patch.dict(rvm.__salt__, {"rvm.install_ruby": mock_install_ruby}): rvm._check_and_install_ruby({"changes": {}}, "1.9.3") mock_install_ruby.assert_called_once_with("1.9.3", runas=None, opts=None, env=None)
def test__check_and_install_ruby(self): mock_check_rvm = MagicMock( return_value={'changes': {}, 'result': True}) mock_check_ruby = MagicMock( return_value={'changes': {}, 'result': False}) mock_install_ruby = MagicMock(return_value="") with patch.object(rvm, '_check_rvm', new=mock_check_rvm): with patch.object(rvm, '_check_ruby', new=mock_check_ruby): with patch.dict(rvm.__salt__, {'rvm.install_ruby': mock_install_ruby}): rvm._check_and_install_ruby({'changes': {}}, '1.9.3') mock_install_ruby.assert_called_once_with('1.9.3', runas=None)
def test__check_and_install_ruby(self): mock_check_rvm = MagicMock( return_value={'changes': {}, 'result': True}) mock_check_ruby = MagicMock( return_value={'changes': {}, 'result': False}) mock_install_ruby = MagicMock(return_value='') with patch.object(rvm, '_check_rvm', new=mock_check_rvm): with patch.object(rvm, '_check_ruby', new=mock_check_ruby): with patch.dict(rvm.__salt__, {'rvm.install_ruby': mock_install_ruby}): rvm._check_and_install_ruby({'changes': {}}, '1.9.3') mock_install_ruby.assert_called_once_with('1.9.3', runas=None, opts=None, env=None)