@@ -72,7 +72,7 @@ public static HttpRequestMatcher httpRequest(TemplateFormat format,
7272RequestMethod requestMethod , String uri ) {
7373if ("adoc" .equals (format .getFileExtension ())) {
7474return new HttpRequestMatcher (requestMethod , uri ,
75- new AsciidoctorCodeBlockMatcher <>("http" ), 3 );
75+ new AsciidoctorCodeBlockMatcher <>("http" , "nowrap" ), 3 );
7676}
7777return new HttpRequestMatcher (requestMethod , uri ,
7878new MarkdownCodeBlockMatcher <>("http" ), 2 );
@@ -82,15 +82,15 @@ public static HttpResponseMatcher httpResponse(TemplateFormat format,
8282HttpStatus status ) {
8383if ("adoc" .equals (format .getFileExtension ())) {
8484return new HttpResponseMatcher (status ,
85- new AsciidoctorCodeBlockMatcher <>("http" ), 3 );
85+ new AsciidoctorCodeBlockMatcher <>("http" , "nowrap" ), 3 );
8686}
8787return new HttpResponseMatcher (status , new MarkdownCodeBlockMatcher <>("http" ), 2 );
8888}
8989
9090@ SuppressWarnings ({ "rawtypes" })
9191public static CodeBlockMatcher <?> codeBlock (TemplateFormat format , String language ) {
9292if ("adoc" .equals (format .getFileExtension ())) {
93- return new AsciidoctorCodeBlockMatcher (language );
93+ return new AsciidoctorCodeBlockMatcher (language , null );
9494}
9595return new MarkdownCodeBlockMatcher (language );
9696}
@@ -180,9 +180,10 @@ public T content(String content) {
180180public static class AsciidoctorCodeBlockMatcher <T extends AsciidoctorCodeBlockMatcher <T >>
181181extends CodeBlockMatcher <T > {
182182
183- protected AsciidoctorCodeBlockMatcher (String language ) {
183+ protected AsciidoctorCodeBlockMatcher (String language , String options ) {
184184super (TemplateFormats .asciidoctor ());
185- this .addLine ("[source," + language + "]" );
185+ this .addLine ("[source," + language
186+ + (options == null ? "" : ",options=\" " + options + "\" " ) + "]" );
186187this .addLine ("----" );
187188this .addLine ("----" );
188189}
0 commit comments