When `obj` argument is a string (X)HTML payload and not a string URL or URI, the following exception is thrown: ```clojure java.lang.ClassCastException: class java.lang.Class cannot be cast to class clojure.lang.IFn ```
14 lines
515 B
Clojure
14 lines
515 B
Clojure
(ns html-to-md.transformer-test
|
|
(:require
|
|
[clojure.string :as str]
|
|
[clojure.test :as t :refer [deftest is testing]]
|
|
[html-to-md.html-to-md :refer [markdown-dispatcher]]
|
|
[html-to-md.transformer :refer [transform]]))
|
|
|
|
(deftest transform-payload
|
|
(testing "String `obj` for: 3. A string representation of an (X)HTML fragment;"
|
|
(is (= "# This is a header"
|
|
(str/trim (-> "<h1>This is a header"
|
|
(transform markdown-dispatcher)
|
|
(first)))))))
|