|
8 | 8 | before(:each) do
|
9 | 9 | Asciidoctor::Extensions.register do
|
10 | 10 | preprocessor CrampedInclude
|
11 |
| - preprocessor ElasticCompatPreprocessor |
12 | 11 | end
|
13 | 12 | end
|
14 | 13 |
|
|
17 | 16 | end
|
18 | 17 |
|
19 | 18 | include_examples "doesn't break line numbers"
|
| 19 | + include_context 'convert without logs' |
20 | 20 |
|
21 |
| - it "allows cramped includes of callout lists" do |
22 |
| - actual = convert <<~ASCIIDOC |
23 |
| - = Test |
| 21 | + context 'when including callout lists without a blank line between them' do |
| 22 | + let(:input) do |
| 23 | + <<~ASCIIDOC |
| 24 | + = Test |
24 | 25 |
|
25 |
| - == Test |
| 26 | + == Test |
26 | 27 |
|
27 |
| - include::resources/cramped_include/colist1.adoc[] |
28 |
| - include::resources/cramped_include/colist2.adoc[] |
29 |
| - ASCIIDOC |
30 |
| - expected = <<~DOCBOOK |
31 |
| - <chapter id="_test"> |
32 |
| - <title>Test</title> |
33 |
| - <section id="P1"> |
34 |
| - <title>P1</title> |
35 |
| - <section id="P1_1"> |
36 |
| - <title>P1.1</title> |
37 |
| - <programlisting language="java" linenumbering="unnumbered">words <1> <2></programlisting> |
38 |
| - <calloutlist> |
39 |
| - <callout arearefs="CO1-1"> |
40 |
| - <para>foo</para> |
41 |
| - </callout> |
42 |
| - </calloutlist> |
43 |
| - </section> |
44 |
| - </section> |
45 |
| - <section id="P2"> |
46 |
| - <title>P2</title> |
47 |
| - <section id="P2_1"> |
48 |
| - <title>P2.1</title> |
49 |
| - <programlisting language="java" linenumbering="unnumbered">words <1> <2></programlisting> |
50 |
| - <calloutlist> |
51 |
| - <callout arearefs="CO2-1"> |
52 |
| - <para>foo</para> |
53 |
| - </callout> |
54 |
| - </calloutlist> |
55 |
| - </section> |
56 |
| - </section> |
57 |
| - </chapter> |
58 |
| - DOCBOOK |
59 |
| - expect(actual).to eq(expected.strip) |
| 28 | + include::resources/cramped_include/colist1.adoc[] |
| 29 | + include::resources/cramped_include/colist2.adoc[] |
| 30 | + ASCIIDOC |
| 31 | + end |
| 32 | + it 'renders both callout lists' do |
| 33 | + expect(converted).to include('<callout arearefs="CO1-1">') |
| 34 | + expect(converted).to include('<callout arearefs="CO2-1">') |
| 35 | + end |
| 36 | + it 'renders the sections that contain the lists' do |
| 37 | + expect(converted).to include('<title>P1</title>') |
| 38 | + expect(converted).to include('<title>P2</title>') |
| 39 | + end |
60 | 40 | end
|
61 | 41 |
|
62 |
| - it "doesn't break includes of non-asciidoc files" do |
63 |
| - actual = convert <<~ASCIIDOC |
64 |
| - ---- |
65 |
| - include::resources/cramped_include/Example.java[] |
66 |
| - ---- |
67 |
| - ASCIIDOC |
68 |
| - expected = <<~DOCBOOK |
69 |
| - <preface> |
70 |
| - <title></title> |
71 |
| - <screen>public class Example {}</screen> |
72 |
| - </preface> |
73 |
| - DOCBOOK |
74 |
| - expect(actual).to eq(expected.strip) |
| 42 | + context 'when including non-asciidoc files' do |
| 43 | + let(:input) do |
| 44 | + <<~ASCIIDOC |
| 45 | + ---- |
| 46 | + include::resources/cramped_include/Example.java[] |
| 47 | + ---- |
| 48 | + ASCIIDOC |
| 49 | + end |
| 50 | + it "doesn't add an extra newline" do |
| 51 | + expect(converted).to include('<screen>public class Example {}</screen>') |
| 52 | + # If it did add an extra new line it'd be here --------------^ |
| 53 | + end |
75 | 54 | end
|
76 | 55 | end
|
0 commit comments