about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/microformats/parser_test.clj30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj
index 0f712de..63c7708 100644
--- a/test/microformats/parser_test.clj
+++ b/test/microformats/parser_test.clj
@@ -70,3 +70,33 @@
 
          {:photo "http://example.com/someimage.png"}
          "<data class=\"u-photo\">http://example.com/someimage.png</data>")))
+
+(deftest parse-dt-elements
+  (testing "Tags with dt-* classes should have their values parsed"
+    (are [ex in] (= ex (parse-dt (first (html-snippet in))))
+         {:start "2012-08-05T14:50"}
+         "<time class=\"dt-start\" datetime=\"2012-08-05T14:50\"></time>"
+
+         {:start "2012-08-05T14:50"}
+         "<time class=\"dt-start\">2012-08-05T14:50</time>"
+
+         {:start "2012-08-05T14:50"}
+         "<ins class=\"dt-start\" datetime=\"2012-08-05T14:50\"></ins>"
+
+         {:end "2012-08-05T18:00"}
+         "<del class=\"dt-end\" datetime=\"2012-08-05T18:00\"></del>"
+
+         {:start "2012-08-05T14:50"}
+         "<abbr class=\"dt-start\" title=\"2012-08-05T14:50\"></abbr>"
+
+         {:start "2012-08-05T14:50"}
+         "<abbr class=\"dt-start\">2012-08-05T14:50</abbr>"
+
+         {:start "2012-08-05T14:50"}
+         "<data class=\"dt-start\" value=\"2012-08-05T14:50\"></data>"
+
+         {:start "2012-08-05T14:50"}
+         "<data class=\"dt-start\">2012-08-05T14:50</data>"
+
+         {:start "2012-08-05T14:50"}
+         "<input class=\"dt-start\" value=\"2012-08-05T14:50\">")))