Merge branch '1.0.x' into 1.1.x
This commit is contained in:
@@ -24,7 +24,6 @@ import org.junit.Test;
|
||||
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.restdocs.templates.TemplateEngine;
|
||||
import org.springframework.restdocs.templates.TemplateFormats;
|
||||
import org.springframework.restdocs.templates.TemplateResourceResolver;
|
||||
import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine;
|
||||
import org.springframework.restdocs.test.ExpectedSnippet;
|
||||
@@ -44,7 +43,7 @@ import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader;
|
||||
public class AsciidoctorRequestFieldsSnippetTests {
|
||||
|
||||
@Rule
|
||||
public ExpectedSnippet snippet = new ExpectedSnippet(TemplateFormats.asciidoctor());
|
||||
public ExpectedSnippet snippet = new ExpectedSnippet(asciidoctor());
|
||||
|
||||
@Test
|
||||
public void requestFieldsWithListDescription() throws IOException {
|
||||
|
||||
@@ -111,10 +111,14 @@ public final class SnippetMatchers {
|
||||
}
|
||||
|
||||
protected void addLine(int index, String line) {
|
||||
if (index < 0) {
|
||||
index = index + this.lines.size();
|
||||
this.lines.add(determineIndex(index), line);
|
||||
}
|
||||
|
||||
private int determineIndex(int index) {
|
||||
if (index >= 0) {
|
||||
return index;
|
||||
}
|
||||
this.lines.add(index, line);
|
||||
return index + this.lines.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user