diff options
author | Alan Pearce | 2014-09-13 20:16:51 +0100 |
---|---|---|
committer | Alan Pearce | 2014-09-13 20:20:01 +0100 |
commit | 023b48cfad96c261f4abfa64c1092bdb39fba1c1 (patch) | |
tree | d21b5d11ff5961bfa317621e556e0cc2c5921ed2 /test | |
parent | 26fe7047ce98ffac571e4c8665e25b8900830a90 (diff) | |
download | microformats-023b48cfad96c261f4abfa64c1092bdb39fba1c1.tar.lz microformats-023b48cfad96c261f4abfa64c1092bdb39fba1c1.tar.zst microformats-023b48cfad96c261f4abfa64c1092bdb39fba1c1.zip |
Add e-* parsing
Diffstat (limited to 'test')
-rw-r--r-- | test/microformats/parser_test.clj | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj index 504ac24..7d837f2 100644 --- a/test/microformats/parser_test.clj +++ b/test/microformats/parser_test.clj @@ -17,6 +17,12 @@ [:location :name] ["someclass" "p-location" "someotherclass" "p-name"]))) +(deftest node-to-html-string + (testing "`node-to-html' should return a string of HTML content" + (are [ex in] (= ex (apply str (#'microformats.parser/node-to-html in))) + "Foo <strong>bar</strong>" + '("Foo " {:tag :strong, :attrs nil, :content ("bar")})))) + (deftest parse-p-inner-text (testing "Inner text of a p- property should be parsed") (are [ex in] (= ex (parse-p (first (html-snippet in)))) @@ -109,3 +115,9 @@ {:start "2012-08-05T14:50"} "<input class=\"dt-start\" value=\"2012-08-05T14:50\">"))) + +(deftest parse-e-elements + (testing "Tags with e-* classes should have ther content parsed" + (are [ex in] (= ex (parse-e (first (html-snippet in)))) + {:content {:html "Here is a load of <strong>embedded markup</strong>" :value "Here is a load of embedded markup"}} + "<div class=\"e-content\">Here is a load of <strong>embedded markup</strong></div>"))) |