@Test public void docbook_document_should_be_rendered_into_current_directory() throws FileNotFoundException, IOException, SAXException, ParserConfigurationException { Map<String, Object> attributes = attributes().backend("docbook").asMap(); Map<String, Object> options = options().inPlace(true).attributes(attributes).asMap(); File inputFile = classpath.getResource("rendersample.asciidoc"); String renderContent = asciidoctor.convertFile(inputFile, options); File expectedFile = new File(inputFile.getParent(), "rendersample.xml"); assertThat(expectedFile.exists(), is(true)); assertThat(renderContent, is(nullValue())); expectedFile.delete(); }
@Test public void docbook_document_should_be_rendered_into_current_directory_using_options_class() throws FileNotFoundException, IOException, SAXException, ParserConfigurationException { Attributes attributes = attributes().backend("docbook").get(); Options options = options().inPlace(true).attributes(attributes).get(); File inputFile = classpath.getResource("rendersample.asciidoc"); String renderContent = asciidoctor.convertFile(inputFile, options); File expectedFile = new File(inputFile.getParent(), "rendersample.xml"); assertThat(expectedFile.exists(), is(true)); assertThat(renderContent, is(nullValue())); expectedFile.delete(); }