Skip to content
Browse files

* test/test_parser.rb: cdata test from darren boyd. thanks!

  • Loading branch information...
1 parent 1c6b20e commit dd71be988994db94ec3f711064a7b8abc15ee7ce _why committed Mar 24, 2009
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/test_parser.rb
View
11 test/test_parser.rb
@@ -406,4 +406,15 @@ def test_uxs_handles_entities
assert_equal "\303\251", Hpricot.uxs('é')
end
end
+
+ def test_cdata_inner_text
+ xml = Hpricot.XML(%{
+ <peon>
+ <id>96586</id>
+ <stdout><![CDATA[This is STDOUT]]></stdout>
+ <stderr><!-- IGNORE --><![CDATA[This is]]> STDERR</stderr>
+ </peon>})
+ assert_equal "This is STDOUT", (xml/:peon/:stdout).inner_text
+ assert_equal "This is STDERR", (xml/:peon/:stderr).inner_text
+ end
end

0 comments on commit dd71be9

Please sign in to comment.
Something went wrong with that request. Please try again.