Implement many more nodes
All checks were successful
CI Pipeline / build (pull_request) Successful in 12s
All checks were successful
CI Pipeline / build (pull_request) Successful in 12s
Adds these new styling and formatting nodes * strike * highlight * linebreaks * pagebreaks * Hyperlinks
This commit is contained in:
@@ -133,4 +133,49 @@ class FormattingTest < Minitest::Test
|
||||
assert_includes xml, "bold+italic "
|
||||
assert_includes xml, "all three"
|
||||
end
|
||||
|
||||
def test_strikethrough_text
|
||||
xml = create_doc_and_read_xml do |doc|
|
||||
doc.p do
|
||||
doc.s { doc.text "strikethrough text" }
|
||||
end
|
||||
end
|
||||
|
||||
assert_includes xml, "<w:strike/>"
|
||||
assert_includes xml, "strikethrough text"
|
||||
end
|
||||
|
||||
def test_strikethrough_with_other_formatting
|
||||
xml = create_doc_and_read_xml do |doc|
|
||||
doc.p do
|
||||
doc.b do
|
||||
doc.s { doc.text "bold and strikethrough" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assert_includes xml, "<w:b/>"
|
||||
assert_includes xml, "<w:strike/>"
|
||||
assert_includes xml, "bold and strikethrough"
|
||||
end
|
||||
|
||||
def test_all_four_formatting_options
|
||||
xml = create_doc_and_read_xml do |doc|
|
||||
doc.p do
|
||||
doc.b do
|
||||
doc.i do
|
||||
doc.u do
|
||||
doc.s { doc.text "all four" }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assert_includes xml, "<w:b/>"
|
||||
assert_includes xml, "<w:i/>"
|
||||
assert_includes xml, '<w:u w:val="single"/>'
|
||||
assert_includes xml, "<w:strike/>"
|
||||
assert_includes xml, "all four"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user