Skip to content
Browse files

Fix incorrect closing CDATA delimiter. Add tests for CDATA nodes.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 1a18227 commit 3bcadc9290c7fab2491e900458ec5b608a037718 @packagethief packagethief committed with jeremy Oct 22, 2008
View
2 actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
@@ -272,7 +272,7 @@ def ==(node)
# itself.
class CDATA < Text #:nodoc:
def to_s
- "<![CDATA[#{super}]>"
+ "<![CDATA[#{super}]]>"
end
end
View
15 actionpack/test/controller/html-scanner/cdata_node_test.rb
@@ -0,0 +1,15 @@
+require 'abstract_unit'
+
+class CDATANodeTest < Test::Unit::TestCase
+ def setup
+ @node = HTML::CDATA.new(nil, 0, 0, "<p>howdy</p>")
+ end
+
+ def test_to_s
+ assert_equal "<![CDATA[<p>howdy</p>]]>", @node.to_s
+ end
+
+ def test_content
+ assert_equal "<p>howdy</p>", @node.content
+ end
+end

0 comments on commit 3bcadc9

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