'Verify that a JenkinsJobException is raised if the plugins_info stub
file does not yield a list as its top-level object.'

@mock.patch('jenkins_jobs.cli.subcommand.update.XmlJobGenerator.generateXML')
@mock.patch('jenkins_jobs.cli.subcommand.update.ModuleRegistry')
def test_bogus_plugins_info_stub_option(self, registry_mock, generateXML_mock):

    plugins_info_stub_yaml_file = os.path.join(self.fixtures_path, 'bogus-plugins-info.yaml')
    args = ['--conf', os.path.join(self.fixtures_path, 'cmd-001.conf'), 'test', '-p', plugins_info_stub_yaml_file, os.path.join(self.fixtures_path, 'cmd-001.yaml')]
    stderr = StringIO()
    with mock.patch('sys.stderr', stderr):
        self.assertRaises(SystemExit, entry.JenkinsJobs, args)
    self.assertIn('must    contain    a    Yaml    list', stderr.getvalue())
