-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for the convert_olist() method.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'minitest/autorun' | ||
require_relative 'helper' | ||
|
||
class OlistTest < Minitest::Test | ||
def test_simple_ordered_list | ||
xml = <<~EOF.chomp.to_dita | ||
. Item one | ||
. Item two | ||
EOF | ||
|
||
assert_xpath_equal xml, 'Item one', '//ol/li[1]/text()' | ||
assert_xpath_equal xml, 'Item two', '//ol/li[2]/text()' | ||
end | ||
|
||
def test_compound_ordered_list | ||
xml = <<~EOF.chomp.to_dita | ||
. Item one | ||
+ | ||
Additional paragraph | ||
. Item two | ||
EOF | ||
|
||
assert_xpath_equal xml, 'Item one', '//ol/li[1]/p[1]/text()' | ||
assert_xpath_equal xml, 'Additional paragraph', '//ol/li[1]/p[2]/text()' | ||
end | ||
|
||
def test_ordered_list_title | ||
xml = <<~EOF.chomp.to_dita | ||
.An ordered list title | ||
. Item one | ||
. Item two | ||
EOF | ||
|
||
assert_xpath_equal xml, 'An ordered list title', '//p[@outputclass="title"]/b/text()' | ||
assert_xpath_count xml, 2, '//ol/li' | ||
end | ||
end |