@Test
public void asciiDoctorFileWillBeAddedWhenBuildingListOfRuleSources() throws IOException {

    File asciiDoctorFile = mock(File.class, new MethodNotMockedAnswer());
    File ruleDirectory = 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();
    doReturn(new File[]{asciiDoctorFile}).when(ruleDirectory).listFiles();
    doReturn(true).when(ruleDirectory).isDirectory();
    doReturn(false).when(ruleDirectory).isFile();
    List<RuleSource> sources = FileRuleSource.getRuleSources(ruleDirectory);
    assertThat(sources, hasSize(1));
    assertThat(sources, Matchers.contains(matchesById("/path/rules.adoc")));
}