Skip to content

Commit

Permalink
verify it can correctly convert XML for tags containing hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
robertzk committed Feb 20, 2015
1 parent 3bfd460 commit 2779cdb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/testthat/test-nonstandard_tags.R
Original file line number Diff line number Diff line change
@@ -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 <- "
<what-if-we-need>
<xml-tags />
<like-this>
2
</like-this>
</what-if-we-need>
"

remove_spacing <- function(x) { gsub("[ \n]", "", x) }
expect_equal(remove_spacing(xml), remove_spacing(expected_xml))
})

0 comments on commit 2779cdb

Please sign in to comment.