summaryrefslogtreecommitdiff
path: root/test/sections_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2018-10-27 01:52:13 -0600
committerGitHub <noreply@github.com>2018-10-27 01:52:13 -0600
commit845322cade05f2b6676d23a09bee273a06c1e9a4 (patch)
tree8983dac4f5bf8ff0b40409cad7ecfbfd589be5dd /test/sections_test.rb
parentb6445be9bffab71b763c8a2e22f71b1317c3f46c (diff)
resolves #2738 use part-signifier and chapter-signifier, if set (PR #2763)
- add value of part-signifier attribute to beginning of title for numbered part - add value of chapter-signifier attribute to beginning of title for numbered chapter - change trailing delimiter of part number from period to colon
Diffstat (limited to 'test/sections_test.rb')
-rw-r--r--test/sections_test.rb56
1 files changed, 54 insertions, 2 deletions
diff --git a/test/sections_test.rb b/test/sections_test.rb
index 0c49d551..7ae8dd81 100644
--- a/test/sections_test.rb
+++ b/test/sections_test.rb
@@ -1436,8 +1436,60 @@ content
EOS
output = convert_string input
- assert_xpath '//h1[@id="_language"][text() = "I. Language"]', output, 1
- assert_xpath '//h1[@id="_processor"][text() = "II. Processor"]', output, 1
+ assert_xpath '//h1[@id="_language"][text() = "I: Language"]', output, 1
+ assert_xpath '//h1[@id="_processor"][text() = "II: Processor"]', output, 1
+ end
+
+ test 'should prepend value of part-signifier attribute to title of numbered part' do
+ input = <<-EOS
+= Book Title
+:doctype: book
+:sectnums:
+:partnums:
+:part-signifier: Part
+
+= Language
+
+== Syntax
+
+content
+
+= Processor
+
+== CLI
+
+content
+ EOS
+
+ output = convert_string input
+ assert_xpath '//h1[@id="_language"][text() = "Part I: Language"]', output, 1
+ assert_xpath '//h1[@id="_processor"][text() = "Part II: Processor"]', output, 1
+ end
+
+ test 'should prepend value of chapter-signifier attribute to title of numbered chapter' do
+ input = <<-EOS
+= Book Title
+:doctype: book
+:sectnums:
+:partnums:
+:chapter-signifier: Chapter
+
+= Language
+
+== Syntax
+
+content
+
+= Processor
+
+== CLI
+
+content
+ EOS
+
+ output = convert_string input
+ assert_xpath '//h2[@id="_syntax"][text() = "Chapter 1. Syntax"]', output, 1
+ assert_xpath '//h2[@id="_cli"][text() = "Chapter 2. CLI"]', output, 1
end
test 'blocks should have level' do