def test_process_files__no_config_comment(self):
        config = {}
        tool = Checkstyle(self.problems, config)
        tool.process_files(self.fixtures)

        problems = self.problems.all()
        eq_(1, len(problems))
        assert_in('could not run `checkstyle`', problems[0].body)
    def test_process_files__missing_config(self):
        config = {'config': 'badness.xml'}
        tool = Checkstyle(self.problems, config)
        tool.process_files(self.fixtures)

        problems = self.problems.all()
        eq_(1, len(problems))
        assert_in('Running `checkstyle` failed', problems[0].body)
        assert_in('config file exists and is valid XML', problems[0].body)
 def test_create_command__with_path_based_standard(self):
     config = {'config': 'test/checkstyle.xml'}
     tool = Checkstyle(self.problems, config, root_dir)
     result = tool.create_command(['some/file.js'])
     expected = [
         'checkstyle', '-f', 'xml', '-c', '/src/test/checkstyle.xml',
         'some/file.js'
     ]
     assert 'checkstyle' in result[0], 'checkstyle is in command name'
     eq_(result, expected)
 def setUp(self):
     self.problems = Problems()
     config = {'config': 'tests/fixtures/checkstyle/config.xml'}
     self.tool = Checkstyle(self.problems, config, root_dir)