aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/html-scanner/node_test.rb
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-03-24 17:21:17 +0000
committerGonçalo Silva <goncalossilva@gmail.com>2011-03-24 17:21:17 +0000
commit9887f238871bb2dd73de6ce8855615bcc5d8d079 (patch)
tree74fa9ff9524a51701cfa23f708b3f777c65b7fe5 /actionpack/test/template/html-scanner/node_test.rb
parentaff821508a16245ebc03510ba29c70379718dfb7 (diff)
parent5214e73850916de3c9127d35a4ecee0424d364a3 (diff)
downloadrails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.gz
rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.bz2
rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.zip
Merge branch 'master' of https://github.com/rails/rails
Diffstat (limited to 'actionpack/test/template/html-scanner/node_test.rb')
-rw-r--r--actionpack/test/template/html-scanner/node_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/test/template/html-scanner/node_test.rb b/actionpack/test/template/html-scanner/node_test.rb
index b0df36877e..f4b9b198e8 100644
--- a/actionpack/test/template/html-scanner/node_test.rb
+++ b/actionpack/test/template/html-scanner/node_test.rb
@@ -1,39 +1,39 @@
require 'abstract_unit'
class NodeTest < Test::Unit::TestCase
-
+
class MockNode
def initialize(matched, value)
@matched = matched
@value = value
end
-
+
def find(conditions)
@matched && self
end
-
+
def to_s
@value.to_s
end
end
-
+
def setup
@node = HTML::Node.new("parent")
@node.children.concat [MockNode.new(false,1), MockNode.new(true,"two"), MockNode.new(false,:three)]
end
-
+
def test_match
assert !@node.match("foo")
end
-
+
def test_tag
assert !@node.tag?
end
-
+
def test_to_s
assert_equal "1twothree", @node.to_s
end
-
+
def test_find
assert_equal "two", @node.find('blah').to_s
end
@@ -58,7 +58,7 @@ class NodeTest < Test::Unit::TestCase
assert node.attributes.has_key?("bar")
assert "<b foo bar>", node.to_s
end
-
+
def test_parse_with_unclosed_tag
s = "<span onmouseover='bang'"
node = nil