From 425b367dbc682b82099b62737cff670316d736f9 Mon Sep 17 00:00:00 2001 From: Jaromir Hradilek Date: Tue, 12 Nov 2024 01:11:11 +0100 Subject: [PATCH] Added tests for the convert_section() method. --- test/test_section.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/test_section.rb diff --git a/test/test_section.rb b/test/test_section.rb new file mode 100644 index 0000000..556aad0 --- /dev/null +++ b/test/test_section.rb @@ -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