def test_roodi(self): ruby_analysis = roodi(self.file_path, self.firehose_results) content = ruby_analysis[1] # this should be the most common error self.assertTrue("Found = in conditional. It should probably be an ==" in content) # just a check to see if there actually are some errors self.assertTrue(len(content) > 4)
def test_roodi_wrappers(self): ruby_analysis = roodi(self.file_path, self.firehose_results) issues = parse_roodi(ruby_analysis[1].splitlines()) i = 0 for issue in issues: if issue.location.file.givenpath == "./spec/support/builders.rb": found = issue i += 1 self.assertEquals(found.location.file.givenpath, "./spec/support/builders.rb") self.assertEquals(found.location.point.line, 4) self.assertEquals(found.location.point.column, 1) self.assertEquals(found.severity, "warning") self.assertTrue("Module \"Builders\" has 648 lines. It should have 300 or less" in found.message.text) self.assertIsNone(found.notes) self.assertIsNone(found.trace) self.assertIsNone(found.customfields) self.assertTrue(i > 100)
def test_roodi_common(): firehorse_results = Analysis(metadata=Metadata( generator=Generator(name='roodi'), sut=None, file_=None, stats=None), results=[]) return roodi("tests/resources/bundler_1.7.4-1.dsc", firehorse_results)
def run(dsc, package, job, firehose): return roodi(dsc, firehose)