Fixed issue with h- class elements being evaluated multiple times

This commit is contained in:
Brian Miller 2011-06-28 19:47:14 -07:00
parent b35a24becc
commit 9777b76b46
3 changed files with 23 additions and 29 deletions

View file

@ -12,7 +12,7 @@
</a>
</h1>
<h1 class="h-card">
<h1 class="panda h-card">
<a class="p-fn u-url" href="http://iamshane.com">
<span class="p-given-name">Shane</span>
<abbr class="p-additional-name">B</abbr>

View file

@ -19,19 +19,9 @@ class TestMicroformats2 < Test::Unit::TestCase
end
def test_extracts_hcard_from_an_html_file
hcard = <<-END
<html>
<head>
<title>Simple hCard</title>
</head>
<body>
<h1 class="h-card">Chris</h1>
</body>
</html>
END
result = Microformats2.parse(File.open(File.join(File.dirname(__FILE__), "simple.html")))
assert_equal HCard, result[:hcard].first.class
assert_equal 2, result[:hcard].length
end
def test_extracts_hcard_from_html