Skip to content

Commit

Permalink
Added more tests for the convert_listing() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhradilek committed Nov 11, 2024
1 parent be3adeb commit b5aa939
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/test_listing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_listing_block_title
EOF

assert_xpath_equal xml, 'A listing block title', '//p[@outputclass="title"]/b/text()'
assert_xpath_equal xml, 'A listing block', '//codeblock/text()'
end

def test_explicit_source_block
Expand All @@ -41,25 +42,28 @@ def test_explicit_source_block
assert_xpath_equal xml, 'A source code block', '//codeblock/text()'
end

def test_delimited_source_block
def test_implied_source_block
xml = <<~EOF.chomp.to_dita
[,ruby]
----
A source code block
puts "Hello"
----
EOF

assert_xpath_equal xml, 'A source code block', '//codeblock/text()'
assert_xpath_equal xml, 'puts "Hello"', '//codeblock/text()'
end

def test_implied_source_block
def test_source_block_title
xml = <<~EOF.chomp.to_dita
[,ruby]
.A source block title
[source]
----
puts "Hello"
A source block
----
EOF

assert_xpath_equal xml, 'puts "Hello"', '//codeblock/text()'
assert_xpath_equal xml, 'A source block title', '//p[@outputclass="title"]/b/text()'
assert_xpath_equal xml, 'A source block', '//codeblock/text()'
end

def test_source_block_language
Expand Down

0 comments on commit b5aa939

Please sign in to comment.