diff options
author | Alan Pearce | 2014-09-13 09:07:35 +0100 |
---|---|---|
committer | Alan Pearce | 2014-09-13 09:07:35 +0100 |
commit | 08f9c2b929f1a19e39a1cda2743da3837f3cc132 (patch) | |
tree | f13ddb4f0589066de6e3210b8ef015f545d34127 /test | |
parent | 672e6221dfd065bba69d097806f10ec7344b4fb9 (diff) | |
download | microformats-08f9c2b929f1a19e39a1cda2743da3837f3cc132.tar.lz microformats-08f9c2b929f1a19e39a1cda2743da3837f3cc132.tar.zst microformats-08f9c2b929f1a19e39a1cda2743da3837f3cc132.zip |
Add u-* parsing capability
Diffstat (limited to 'test')
-rw-r--r-- | test/microformats/parser_test.clj | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj index a28261e..26cb094 100644 --- a/test/microformats/parser_test.clj +++ b/test/microformats/parser_test.clj @@ -36,3 +36,24 @@ {:items [{:properties {:name ""}}] :rels {}} "<div class=\"h-card\"><hr class=\"p-name\"/></div>"))) + +(deftest parse-u-elements + (testing "Tags should have their values parsed as a u-* value" + (are [ex in] (= ex (parse in)) + {:items [{:properties {:url "http://example.com"}}] :rels {}} + "<div class=\"h-card\"><a class=\"u-url\" href=\"http://example.com\">Awesome example website</a></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><img class=\"u-photo\" src=\"http://example.com/someimage.png\"></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<map class=\"h-card\"><area class=\"u-photo\" href=\"http://example.com/someimage.png\"></area></map>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><object class=\"u-photo\" data=\"http://example.com/someimage.png\"></object></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><abbr class=\"u-photo\" title=\"http://example.com/someimage.png\"></abbr></div>" + + {:items [{:properties {:photo "http://example.com/someimage.png"}}] :rels {}} + "<div class=\"h-card\"><data class=\"u-photo\" value=\"http://example.com/someimage.png\"></data></div>"))) |