Skip to content

Commit 1d3e120

Browse files
committed
Upgrade to Asciidoctor 2.0.18
1 parent 7903f39 commit 1d3e120

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

CHANGELOG.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co
1313

1414
== Unreleased
1515

16+
Improvement::
17+
18+
* Upgrade to asciidoctorj 2.0.18 (#1126)
19+
1620
== 2.5.6 (2022-09-19)
1721

1822
Improvement::

asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionGroupIsRegistered.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@
4646
import static org.hamcrest.CoreMatchers.not;
4747
import static org.hamcrest.CoreMatchers.notNullValue;
4848
import static org.hamcrest.CoreMatchers.startsWith;
49+
import static org.hamcrest.MatcherAssert.assertThat;
4950
import static org.hamcrest.Matchers.hasSize;
51+
import static org.junit.Assert.assertEquals;
5052
import static org.junit.Assert.assertNotNull;
5153
import static org.junit.Assert.assertNull;
52-
import static org.junit.Assert.assertThat;
5354
import static org.junit.Assert.assertTrue;
5455

5556
@RunWith(Arquillian.class)
@@ -111,8 +112,6 @@ private StringBuilder readContent(String target) {
111112

112113
bufferedReader.close();
113114

114-
} catch (MalformedURLException e) {
115-
throw new IllegalArgumentException(e);
116115
} catch (IOException e) {
117116
throw new IllegalArgumentException(e);
118117
}
@@ -180,8 +179,6 @@ private StringBuilder readContent(String target) {
180179

181180
bufferedReader.close();
182181

183-
} catch (MalformedURLException e) {
184-
throw new IllegalArgumentException(e);
185182
} catch (IOException e) {
186183
throw new IllegalArgumentException(e);
187184
}
@@ -242,7 +239,7 @@ public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() {
242239

243240
Element footer = doc.getElementById("footer");
244241
// Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element
245-
assertTrue("robots".equals(footer.nextElementSibling().attr("name")));
242+
assertEquals("robots", footer.nextElementSibling().attr("name"));
246243
}
247244

248245
@Test
@@ -436,7 +433,7 @@ public void a_include_processor_should_only_handle_its_handles() {
436433

437434
org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
438435

439-
Element contentElement = doc.getElementsByAttributeValue("class", "bare").first();
436+
Element contentElement = doc.getElementsByClass("bare").first();
440437

441438
assertThat(contentElement.text(), startsWith("sample-book.adoc"));
442439

asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenJavaExtensionIsRegistered.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
import static org.hamcrest.CoreMatchers.not;
4848
import static org.hamcrest.CoreMatchers.notNullValue;
4949
import static org.hamcrest.CoreMatchers.startsWith;
50+
import static org.hamcrest.MatcherAssert.assertThat;
5051
import static org.hamcrest.Matchers.hasSize;
52+
import static org.junit.Assert.assertEquals;
5153
import static org.junit.Assert.assertNotNull;
5254
import static org.junit.Assert.assertNull;
5355
import static org.junit.Assert.assertSame;
54-
import static org.junit.Assert.assertThat;
55-
import static org.junit.Assert.assertTrue;
5656

5757
@RunWith(Arquillian.class)
5858
public class WhenJavaExtensionIsRegistered {
@@ -239,7 +239,7 @@ public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() {
239239

240240
Element footer = doc.getElementById("footer");
241241
// Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element
242-
assertTrue("robots".equals(footer.nextElementSibling().attr("name")));
242+
assertEquals("robots", footer.nextElementSibling().attr("name"));
243243
}
244244

245245
@Test
@@ -429,11 +429,11 @@ public void a_include_processor_should_only_handle_its_handles() {
429429
javaExtensionRegistry.includeProcessor(UriIncludeProcessor.class);
430430

431431
String content = asciidoctor.convertFile(classpath.getResource("sample-with-include.ad"),
432-
options().toFile(false).get());
432+
Options.builder().toFile(false).build());
433433

434434
org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
435435

436-
Element contentElement = doc.getElementsByAttributeValue("class", "bare").first();
436+
Element contentElement = doc.getElementsByClass("bare").first();
437437

438438
assertThat(contentElement.text(), startsWith("sample-book.adoc"));
439439

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ ext {
7979
pdfboxVersion = '1.8.16'
8080

8181
// gem versions
82-
asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '2.0.17'
83-
asciimathGemVersion = '2.0.3'
82+
asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '2.0.18'
83+
asciimathGemVersion = '2.0.4'
8484
coderayGemVersion = '1.1.3'
8585
rougeGemVersion = '3.30.0'
8686

0 commit comments

Comments
 (0)