#NEWLINE# def test_installed( self ) : #NEWLINE# #INDENT# mock = MagicMock ( ) #NEWLINE# with patch . object ( rvm , '_check_rvm' ) as mock_method : #NEWLINE# #INDENT# mock_method . return_value = { #NEWLINE# #INDENT# 'result' : True , #NEWLINE# #UNINDENT# } #NEWLINE# with patch . object ( rvm , '_check_and_install_ruby' , new = self ) : #NEWLINE# #INDENT# rvm . installed ( '1.9.3' , default = True ) #NEWLINE# #UNINDENT# #UNINDENT# mock . assert_called_once_with ( { #NEWLINE# #INDENT# 'result' : True , #NEWLINE# #UNINDENT# } , '1.9.3' , True , user = None )