diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2020-02-29 22:49:26 +0300 |
|---|---|---|
| committer | Marat Radchenko <marat@slonopotamus.org> | 2020-02-29 22:49:26 +0300 |
| commit | e7feab8593aecda391bc7a7409f60842c082bb73 (patch) | |
| tree | 52948f747545c155f3984b9d81e20f1dd964ad14 /spec | |
| parent | 9099da0c491ba01b85402954015cb87f2349e584 (diff) | |
test that appendix properly gets its own chapter file
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/converter_spec.rb | 10 | ||||
| -rw-r--r-- | spec/fixtures/appendix.adoc | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index 639a48c..7674f35 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -50,6 +50,16 @@ describe Asciidoctor::Epub3::Converter do expect(preamble.content).to include %(I am a preamble) end + it 'converts appendix to a separate book chapter' do + book, = to_epub 'appendix.adoc' + spine = book.spine.itemref_list + expect(spine).to have_size(2) + + appendix = book.items[spine[1].idref] + expect(appendix).not_to be_nil + expect(appendix.href).to eq('appendix.xhtml') + end + it 'converts multi-part book' do book, = to_epub 'multi-part.adoc' spine = book.spine.itemref_list diff --git a/spec/fixtures/appendix.adoc b/spec/fixtures/appendix.adoc new file mode 100644 index 0000000..997e95a --- /dev/null +++ b/spec/fixtures/appendix.adoc @@ -0,0 +1,15 @@ += Appendix book +:doctype: book +:idprefix: +:idseparator: - + +Preamble + +[appendix] +== Appendix + +One + +=== Subsection + +Two |
