def test_installed(self): mock = MagicMock() with patch.object(rvm, '_check_rvm', return_value={'result': True}): with patch.object(rvm, '_check_and_install_ruby', new=mock): rvm.installed("1.9.3", default=True) mock.assert_called_once_with( {'result': True}, '1.9.3', True, runas=None)
def test_installed(self): mock = MagicMock() with patch.object(rvm, '_check_rvm') as mock_method: mock_method.return_value = {'result': True} with patch.object(rvm, '_check_and_install_ruby', new=mock): rvm.installed('1.9.3', default=True) mock.assert_called_once_with( {'result': True}, '1.9.3', True, user=None, opts=None, env=None)
def test_installed_with_opts(self): mock = MagicMock() with patch.object(rvm, '_check_rvm') as mock_method: mock_method.return_value = {'result': True} with patch.object(rvm, '_check_and_install_ruby', new=mock): rvm.installed('1.9.3', default=True, opts=[{'-C': '--enable-shared,--with-readline-dir=$HOME/.rvm/usr'}]) mock.assert_called_once_with( {'result': True}, '1.9.3', True, user=None, opts=[{'-C': '--enable-shared,--with-readline-dir=$HOME/.rvm/usr'}], env=None)
def test_installed(self): mock = MagicMock() with patch.object(rvm, "_check_rvm") as mock_method: mock_method.return_value = {"result": True} with patch.object(rvm, "_check_and_install_ruby", new=mock): rvm.installed("1.9.3", default=True) mock.assert_called_once_with( {"result": True}, "1.9.3", True, user=None, opts=None, env=None )
def test_installed_with_env(self): mock = MagicMock() with patch.object(rvm, "_check_rvm") as mock_method: mock_method.return_value = {"result": True} with patch.object(rvm, "_check_and_install_ruby", new=mock): rvm.installed( "1.9.3", default=True, env=[{"RUBY_CONFIGURE_OPTS": "--foobar"}] ) mock.assert_called_once_with( {"result": True}, "1.9.3", True, user=None, opts=None, env=[{"RUBY_CONFIGURE_OPTS": "--foobar"}], )
def test_installed_with_opts(self): mock = MagicMock() with patch.object(rvm, "_check_rvm") as mock_method: mock_method.return_value = {"result": True} with patch.object(rvm, "_check_and_install_ruby", new=mock): rvm.installed( "1.9.3", default=True, opts=[{"-C": "--enable-shared,--with-readline-dir=$HOME/.rvm/usr"}], ) mock.assert_called_once_with( {"result": True}, "1.9.3", True, user=None, opts=[{"-C": "--enable-shared,--with-readline-dir=$HOME/.rvm/usr"}], env=None, )