Skip to content

Commit

Permalink
issue-16 Added test for procedure and procedure nested inside itemize…
Browse files Browse the repository at this point in the history
…dlist
  • Loading branch information
fbolton committed Jan 4, 2017
1 parent 1b1a948 commit acfe3f6
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions spec/lib/docbookrx/docbookrx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,76 @@
expect(output).to include(expected)
end

it 'should convert itemizedlist nested inside procedure, and procedure nested inside itemizedlist correctly' do
input = <<-EOS
<article xmlns='http://docbook.org/ns/docbook'
xmlns:xl="http://www.w3.org/1999/xlink"
version="5.0" xml:lang="en">
<itemizedlist>
<listitem>
<para>simple</para>
</listitem>
<listitem>
<para>procedure inside listitem</para>
<procedure>
<step>
<para>first step</para>
</step>
<step>
<para>second step</para>
</step>
</procedure>
</listitem>
</itemizedlist>
<para>break!</para>
<procedure>
<step>
<para>first step</para>
</step>
<step>
<para>second step</para>
</step>
<step>
<para>third step is a nested itemizedlist</para>
<itemizedlist>
<listitem>
<para>foo</para>
</listitem>
<listitem>
<para>bar</para>
</listitem>
</itemizedlist>
</step>
<step>
<para>fourth step</para>
</step>
</procedure>
</article>
EOS

expected = <<-EOS
* simple
* procedure inside listitem
.. first step
.. second step
break!
. first step
. second step
. third step is a nested itemizedlist
** foo
** bar
. fourth step
EOS
output = Docbookrx.convert input

expect(output).to include(expected)
end

it 'should add all table lines and escape | characters in table text' do
input = <<-EOS
<article xmlns='http://docbook.org/ns/docbook'
Expand Down

0 comments on commit acfe3f6

Please sign in to comment.