-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolves #210 by redirecting asciidoctor console output to java logge…
…r system.
- Loading branch information
1 parent
8c4fe81
commit 5c1b27d
Showing
8 changed files
with
127 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
asciidoctorj-core/src/test/java/org/asciidoctor/WhenAsciidoctorLogsToConsole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.asciidoctor; | ||
|
||
import org.asciidoctor.internal.JRubyAsciidoctor; | ||
import org.asciidoctor.util.ClasspathResources; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
import java.io.File; | ||
|
||
import static org.asciidoctor.OptionsBuilder.options; | ||
|
||
public class WhenAsciidoctorLogsToConsole { | ||
|
||
@Rule | ||
public ClasspathResources classpath = new ClasspathResources(); | ||
|
||
@Rule | ||
public TemporaryFolder testFolder = new TemporaryFolder(); | ||
|
||
private Asciidoctor asciidoctor = JRubyAsciidoctor.create(); | ||
|
||
@Test | ||
public void shouldBeRedirectToAsciidoctorJLoggerSystem() { | ||
|
||
File inputFile = classpath.getResource("documentwithnotexistingfile.adoc"); | ||
String renderContent = asciidoctor.renderFile(inputFile, options() | ||
.inPlace(true).safe(SafeMode.SERVER).asMap()); | ||
|
||
File expectedFile = new File(inputFile.getParent(), "documentwithnotexistingfile.html"); | ||
expectedFile.delete(); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
asciidoctorj-core/src/test/resources/documentwithnotexistingfile.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
= My Document | ||
|
||
include::unexistingdoc.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5c1b27d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less dependencies. Yeah!