Skip to content

Commit

Permalink
Added tests for the convert_section() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhradilek committed Nov 12, 2024
1 parent ac01db4 commit 425b367
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_section.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'minitest/autorun'
require_relative 'helper'

class SectionTest < Minitest::Test
def test_section_structure
xml = <<~EOF.chomp.to_dita
[#topic-id]
= Topic title
[#section-id]
== Section title
Section contents.
EOF

assert_xpath_equal xml, 'section-id', '//section/@id'
assert_xpath_equal xml, 'Section title', '//section/title/text()'
assert_xpath_equal xml, 'Section contents.', '//section/p/text()'
end
end

0 comments on commit 425b367

Please sign in to comment.