all repos — archive/microformats @ 8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2

Incomplete Clojure microformats library

Add tests for classes-to-props

Alan Pearce
commit

8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2

parent

e8a96393c8e6c2b5f94e43e58680ee90a2b5a6b0

1 file changed, 9 insertions(+), 0 deletions(-)

jump to
M test/microformats/parser_test.cljtest/microformats/parser_test.clj
@@ -8,6 +8,15 @@ (testing "Empty HTML document should return an empty 'items' array and 'rels' hash."
(is (= {:items [] :rels {}} (parse ""))))) +(deftest classes-to-props-property-names + (testing "`classes-to-props' should return property name without prefix" + (are [ex in] (= ex (into [] ((classes-to-props "p-") in))) + [:location] + ["someclass" "p-location" "someotherclass"] + + [:location :name] + ["someclass" "p-location" "someotherclass" "p-name"]))) + (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))))