From 3dd7083d7bae38552ea62f79b8f35e105aa79d7a Mon Sep 17 00:00:00 2001 From: jem Date: Wed, 17 Jun 2020 18:23:27 +0200 Subject: [PATCH] add test & fix spec issue --- src/main/mastodon_bot/rss_api.cljs | 2 +- src/test/mastodon_bot/rss_api_test.cljs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 src/test/mastodon_bot/rss_api_test.cljs diff --git a/src/main/mastodon_bot/rss_api.cljs b/src/main/mastodon_bot/rss_api.cljs index 71d3332..1443cca 100755 --- a/src/main/mastodon_bot/rss_api.cljs +++ b/src/main/mastodon_bot/rss_api.cljs @@ -8,7 +8,7 @@ )) (s/def ::feed (s/cat :name string? :url string?)) -(s/def ::feeds (s/* ::feed)) +(s/def ::feeds (s/coll-of ::feed)) (def rss-source? (s/keys :req-un [::feeds])) (defn-spec rss-client any? diff --git a/src/test/mastodon_bot/rss_api_test.cljs b/src/test/mastodon_bot/rss_api_test.cljs new file mode 100755 index 0000000..32daec5 --- /dev/null +++ b/src/test/mastodon_bot/rss_api_test.cljs @@ -0,0 +1,11 @@ +(ns mastodon-bot.rss-api-test + (:require + [cljs.test :refer-macros [deftest is testing run-tests]] + [clojure.spec.alpha :as s] + [mastodon-bot.rss-api :as sut] + )) + +(deftest test-spec + (is (s/valid? sut/rss-source? + {:feeds [["correctiv-blog" "https://news.correctiv.org/news/rss.php"]]} + )))