@Test
public void knownRuleSourceTypesWillBeAddedWhenBuildingListOfRuleSources() throws Exception {

    File markDownFile = mock(File.class, new MethodNotMockedAnswer());
    doReturn(true).when(markDownFile).isFile();
    doReturn(false).when(markDownFile).isDirectory();
    doReturn("readme.md").when(markDownFile).getName();
    doReturn("/path/readme.md").when(markDownFile).getAbsolutePath();
    File xmlFile = mock(File.class, new MethodNotMockedAnswer());
    doReturn(true).when(xmlFile).isFile();
    doReturn(false).when(xmlFile).isDirectory();
    doReturn("rules.xml").when(xmlFile).getName();
    doReturn("/path/rules.xml").when(xmlFile).getAbsolutePath();
    File asciiDoctorFile = mock(File.class, new MethodNotMockedAnswer());
    doReturn(true).when(asciiDoctorFile).isFile();
    doReturn(false).when(asciiDoctorFile).isDirectory();
    doReturn("rules.adoc").when(asciiDoctorFile).getName();
    doReturn("/path/rules.adoc").when(asciiDoctorFile).getAbsolutePath();
    File ruleDirectory = mock(File.class, new MethodNotMockedAnswer());
    doReturn(new File[]{asciiDoctorFile, xmlFile, markDownFile}).when(ruleDirectory).listFiles();
    doReturn(true).when(ruleDirectory).isDirectory();
    doReturn(false).when(ruleDirectory).isFile();
    List<RuleSource> sources = FileRuleSource.getRuleSources(ruleDirectory);
    assertThat(sources, hasSize(3));
    assertThat(sources, hasItem(matchesById("/path/readme.md")));
    assertThat(sources, hasItem(matchesById("/path/rules.xml")));
    assertThat(sources, hasItem(matchesById("/path/rules.adoc")));
}