require "spec_helper"
RSpec.describe Asciidoctor::Iec do
it "processes simple lists" do
output = Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
#{ASCIIDOC_BLANK_HDR}
* List 1
* List 2
* List 3
. List A
. List B
. List C
List D:: List E
List F:: List G
INPUT
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
#{BLANK_HDR}
-
List 1
-
List 2
-
List 3
-
List A
-
List B
-
List C
- List D
-
List E
- List F
-
List G
OUTPUT
end
it "processes complex lists" do
output = Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
#{ASCIIDOC_BLANK_HDR}
[[id]]
* First
* Second
+
--
entry1
entry2
--
[[id1]]
[loweralpha]
. First
. Second
[upperalpha]
.. Third
.. Fourth
. Fifth
. Sixth
[lowerroman]
. A
. B
[upperroman]
.. C
.. D
[arabic]
... E
... F
Notes1::
Notes:: Note 1.
+
Note 2.
+
Note 3.
INPUT
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
#{BLANK_HDR}
-
First
Second
entry1
entry2
-
First
-
Second
-
Third
-
Fourth
-
Fifth
-
Sixth
-
A
-
B
-
C
-
D
-
E
-
F
- Notes1
- Notes
Note 1.
Note 2.
Note 3.
OUTPUT
end
it "anchors lists and list items" do
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
#{ASCIIDOC_BLANK_HDR}
[[id1]]
* [[id2]] List item
* Hello [[id3]] List item
INPUT
#{BLANK_HDR}
-
List item
-
Hello List item
OUTPUT
end
end