diff --git a/tests/testthat/test-nonstandard_tags.R b/tests/testthat/test-nonstandard_tags.R new file mode 100644 index 0000000..416df49 --- /dev/null +++ b/tests/testthat/test-nonstandard_tags.R @@ -0,0 +1,22 @@ +context('nonstandard tags') + +test_that('it can correctly convert XML for tags containing hyphens', { + xml <- rokogiri({ + "what-if-we-need"({ + "xml-tags"() + "like-this"(2) + }) + }) + + expected_xml <- " + + + + 2 + + + " + + remove_spacing <- function(x) { gsub("[ \n]", "", x) } + expect_equal(remove_spacing(xml), remove_spacing(expected_xml)) +})