summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2014-09-18 02:52:21 -0600
committerDan Allen <dan.j.allen@gmail.com>2014-09-18 02:52:21 -0600
commitb4e19c9137ae6e11f7210ef86df2f543bdf5b63b (patch)
tree936770933f8a79c9fbd488cd61c0506a65bc147f /test
parentb574b0cd9f4b7dccdfc12e7e723f6dfeaabd0879 (diff)
resolves #1091 set maxdepth attribute on AsciiDoc processing instructions in DocBook output
Diffstat (limited to 'test')
-rw-r--r--test/document_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/document_test.rb b/test/document_test.rb
index 7db9da1a..3df4949b 100644
--- a/test/document_test.rb
+++ b/test/document_test.rb
@@ -78,9 +78,21 @@ context 'Document' do
end
test 'toc and sectnums should be enabled by default for DocBook backend' do
- doc = empty_document :backend => 'docbook', :parse => true
+ doc = document_from_string 'content', :backend => 'docbook', :parse => true
assert doc.attr?('toc')
assert doc.attr?('sectnums')
+ result = doc.convert
+ assert_match('<?asciidoc-toc?>', result)
+ assert_match('<?asciidoc-numbered?>', result)
+ end
+
+ test 'maxdepth attribute should be set on asciidoc-toc and asciidoc-numbered processing instructions in DocBook backend' do
+ doc = document_from_string 'content', :backend => 'docbook', :parse => true, :attributes => {'toclevels' => '1', 'sectnumlevels' => '1' }
+ assert doc.attr?('toc')
+ assert doc.attr?('sectnums')
+ result = doc.convert
+ assert_match('<?asciidoc-toc maxdepth="1"?>', result)
+ assert_match('<?asciidoc-numbered maxdepth="1"?>', result)
end
test 'should be able to disable toc and sectnums in document header for DocBook backend' do