From 8b1d5a04c16d2f8a3be5352b06e6b4c815ff4eb2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 13 Sep 2014 10:26:54 +0100 Subject: Add tests for classes-to-props --- test/microformats/parser_test.clj | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') 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)))) -- cgit 1.4.1