示例#1
0
    def test_list(self):
        list_output = '''
rvm rubies

   jruby-1.6.5.1 [ amd64 ]
   ree-1.8.7-2011.03 [ x86_64 ]
   ree-1.8.7-2011.12 [ x86_64 ]
=* ree-1.8.7-2012.02 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]
   ruby-1.9.3-p125 [ x86_64 ]
   ruby-head [ x86_64 ]

# => - current
# =* - current && default
#  * - default

'''
        with patch.object(rvm, '_rvm') as mock_method:
            mock_method.return_value = list_output
            self.assertEqual(
                [['jruby', '1.6.5.1', False], ['ree', '1.8.7-2011.03', False],
                 ['ree', '1.8.7-2011.12', False],
                 ['ree', '1.8.7-2012.02', True], ['ruby', '1.9.2-p180', False],
                 ['ruby', '1.9.3-p125', False], ['ruby', 'head', False]],
                rvm.list_())
示例#2
0
文件: rvm_test.py 项目: herlo/salt
    def test_list(self):
        list_output = '''
rvm rubies

   jruby-1.6.5.1 [ amd64 ]
   ree-1.8.7-2011.03 [ x86_64 ]
   ree-1.8.7-2011.12 [ x86_64 ]
=* ree-1.8.7-2012.02 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]
   ruby-1.9.3-p125 [ x86_64 ]
   ruby-head [ x86_64 ]

# => - current
# =* - current && default
#  * - default

'''
        with patch.object(rvm, '_rvm') as mock_method:
            mock_method.return_value = list_output
            self.assertEqual(
                [['jruby', '1.6.5.1', False],
                 ['ree', '1.8.7-2011.03', False],
                 ['ree', '1.8.7-2011.12', False],
                 ['ree', '1.8.7-2012.02', True],
                 ['ruby', '1.9.2-p180', False],
                 ['ruby', '1.9.3-p125', False],
                 ['ruby', 'head', False]],
                rvm.list_())
示例#3
0
    def test_list(self):
        list_output = """
rvm rubies

   jruby-1.6.5.1 [ amd64 ]
   ree-1.8.7-2011.03 [ x86_64 ]
   ree-1.8.7-2011.12 [ x86_64 ]
=* ree-1.8.7-2012.02 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]
   ruby-1.9.3-p125 [ x86_64 ]
   ruby-head [ x86_64 ]

# => - current
# =* - current && default
#  * - default

"""
        with patch.object(rvm, "_rvm") as mock_method:
            mock_method.return_value = list_output
            self.assertEqual(
                [
                    ["jruby", "1.6.5.1", False],
                    ["ree", "1.8.7-2011.03", False],
                    ["ree", "1.8.7-2011.12", False],
                    ["ree", "1.8.7-2012.02", True],
                    ["ruby", "1.9.2-p180", False],
                    ["ruby", "1.9.3-p125", False],
                    ["ruby", "head", False],
                ],
                rvm.list_(),
            )
示例#4
0
文件: rvm_test.py 项目: DaveQB/salt
    def test_list(self):
        list_output = """
rvm rubies

   jruby-1.6.5.1 [ amd64 ]
   ree-1.8.7-2011.03 [ x86_64 ]
   ree-1.8.7-2011.12 [ x86_64 ]
=* ree-1.8.7-2012.02 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]
   ruby-1.9.3-p125 [ x86_64 ]
   ruby-head [ x86_64 ]

# => - current
# =* - current && default
#  * - default

"""
        with patch.object(rvm, "_rvm") as mock_method:
            mock_method.return_value = list_output
            self.assertEqual(
                [
                    ["jruby", "1.6.5.1", False],
                    ["ree", "1.8.7-2011.03", False],
                    ["ree", "1.8.7-2011.12", False],
                    ["ree", "1.8.7-2012.02", True],
                    ["ruby", "1.9.2-p180", False],
                    ["ruby", "1.9.3-p125", False],
                    ["ruby", "head", False],
                ],
                rvm.list_(),
            )