Skip to content

Commit 2da1a0a

Browse files
committed
Update tests following nowrap changes made in bab779a
Closes gh-204
1 parent bab779a commit 2da1a0a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spring-restdocs-core/src/test/java/org/springframework/restdocs/test/SnippetMatchers.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static HttpRequestMatcher httpRequest(TemplateFormat format,
7272
RequestMethod requestMethod, String uri) {
7373
if ("adoc".equals(format.getFileExtension())) {
7474
return new HttpRequestMatcher(requestMethod, uri,
75-
new AsciidoctorCodeBlockMatcher<>("http"), 3);
75+
new AsciidoctorCodeBlockMatcher<>("http", "nowrap"), 3);
7676
}
7777
return new HttpRequestMatcher(requestMethod, uri,
7878
new MarkdownCodeBlockMatcher<>("http"), 2);
@@ -82,15 +82,15 @@ public static HttpResponseMatcher httpResponse(TemplateFormat format,
8282
HttpStatus status) {
8383
if ("adoc".equals(format.getFileExtension())) {
8484
return new HttpResponseMatcher(status,
85-
new AsciidoctorCodeBlockMatcher<>("http"), 3);
85+
new AsciidoctorCodeBlockMatcher<>("http", "nowrap"), 3);
8686
}
8787
return new HttpResponseMatcher(status, new MarkdownCodeBlockMatcher<>("http"), 2);
8888
}
8989

9090
@SuppressWarnings({ "rawtypes" })
9191
public static CodeBlockMatcher<?> codeBlock(TemplateFormat format, String language) {
9292
if ("adoc".equals(format.getFileExtension())) {
93-
return new AsciidoctorCodeBlockMatcher(language);
93+
return new AsciidoctorCodeBlockMatcher(language, null);
9494
}
9595
return new MarkdownCodeBlockMatcher(language);
9696
}
@@ -180,9 +180,10 @@ public T content(String content) {
180180
public static class AsciidoctorCodeBlockMatcher<T extends AsciidoctorCodeBlockMatcher<T>>
181181
extends CodeBlockMatcher<T> {
182182

183-
protected AsciidoctorCodeBlockMatcher(String language) {
183+
protected AsciidoctorCodeBlockMatcher(String language, String options) {
184184
super(TemplateFormats.asciidoctor());
185-
this.addLine("[source," + language + "]");
185+
this.addLine("[source," + language
186+
+ (options == null ? "" : ",options=\"" + options + "\"") + "]");
186187
this.addLine("----");
187188
this.addLine("----");
188189
}

0 commit comments

Comments
 (0)