about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-09-13 10:26:54 +0100
committerAlan Pearce2014-09-13 10:27:38 +0100
commit8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2 (patch)
treedb5cba647a0e572c1bca5dc1094f300f0c8f4b91
parente8a96393c8e6c2b5f94e43e58680ee90a2b5a6b0 (diff)
downloadmicroformats-8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2.tar.lz
microformats-8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2.tar.zst
microformats-8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2.zip
Add tests for classes-to-props
-rw-r--r--test/microformats/parser_test.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj
index 63c7708..504ac24 100644
--- a/test/microformats/parser_test.clj
+++ b/test/microformats/parser_test.clj
@@ -8,6 +8,15 @@
     (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))))