def test__check_ruby(self): mock = MagicMock(return_value=[['ruby', '1.9.3-p125', False], ['jruby', '1.6.5.1', True]]) with patch.dict(rvm.__salt__, {'rvm.list': mock}): for ruby, result in six.iteritems({'1.9.3': True, 'ruby-1.9.3': True, 'ruby-1.9.3-p125': True, '1.9.3-p125': True, '1.9.3-p126': False, 'rbx': False, 'jruby': True, 'jruby-1.6.5.1': True, 'jruby-1.6': False, 'jruby-1.9.3': False, 'jruby-1.9.3-p125': False}): ret = rvm._check_ruby({'changes': {}, 'result': False}, ruby) self.assertEqual(result, ret['result'])
def test__check_ruby(self): mock = MagicMock(return_value=[['ruby', '1.9.3-p125', False], ['jruby', '1.6.5.1', True]]) with patch.dict(rvm.__salt__, {'rvm.list': mock}): for ruby, result in {'1.9.3': True, 'ruby-1.9.3': True, 'ruby-1.9.3-p125': True, '1.9.3-p125': True, '1.9.3-p126': False, 'rbx': False, 'jruby': True, 'jruby-1.6.5.1': True, 'jruby-1.6': False, 'jruby-1.9.3': False, 'jruby-1.9.3-p125': False}.items(): ret = rvm._check_ruby({'changes': {}, 'result': False}, ruby) self.assertEqual(result, ret['result'])
def test__check_ruby(): mock = MagicMock( return_value=[["ruby", "1.9.3-p125", False], ["jruby", "1.6.5.1", True]] ) with patch.dict(rvm.__salt__, {"rvm.list": mock}): for ruby, result in { "1.9.3": True, "ruby-1.9.3": True, "ruby-1.9.3-p125": True, "1.9.3-p125": True, "1.9.3-p126": False, "rbx": False, "jruby": True, "jruby-1.6.5.1": True, "jruby-1.6": False, "jruby-1.9.3": False, "jruby-1.9.3-p125": False, }.items(): ret = rvm._check_ruby({"changes": {}, "result": False}, ruby) assert result == ret["result"]