summaryrefslogtreecommitdiff
path: root/test/sections_test.rb
diff options
context:
space:
mode:
authorDan Allen <dallen@redhat.com>2013-04-20 12:49:51 -0600
committerDan Allen <dallen@redhat.com>2013-04-22 12:26:48 -0600
commitefeda152d248735bc2ccfcb580010fa7a5dfac92 (patch)
tree4510aa744f70541ee09f52e939c90278aeb0fedb /test/sections_test.rb
parent7705123f8dc9e89468ac5b86ce4862809d46d5a3 (diff)
resolves #187 complete masquerade functionality for blocks & paragraphs
- rework block parsing - move block creation to a separate method - add method to assign or generate block caption - add set_attr method to block - use sets where appropriate to improve speed - cleanup two-line section matching - optimize reader operations - add flags to control compliance w/ AsciiDoc - tests for masquerading, captions and other compliance
Diffstat (limited to 'test/sections_test.rb')
-rw-r--r--test/sections_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/sections_test.rb b/test/sections_test.rb
index cd881d47..4bf2891f 100644
--- a/test/sections_test.rb
+++ b/test/sections_test.rb
@@ -257,6 +257,23 @@ not in section
assert floatingtitle.is_a?(Asciidoctor::Block)
assert !floatingtitle.is_a?(Asciidoctor::Section)
assert_equal :floating_title, floatingtitle.context
+ assert_equal '_plain_ol_heading', floatingtitle.id
+ assert doc.references[:ids].has_key?('_plain_ol_heading')
+ end
+
+ test 'can assign explicit id to floating title' do
+ input = <<-EOS
+[[unchained]]
+[float]
+=== Plain Ol' Heading
+
+not in section
+ EOS
+
+ doc = document_from_string input
+ floating_title = doc.blocks.first
+ assert_equal 'unchained', floating_title.id
+ assert doc.references[:ids].has_key?('unchained')
end
test 'should not include floating title in toc' do