2016-09-24 08:28:13 +00:00
|
|
|
(ns pronouns.pages-test
|
|
|
|
(:require [pronouns.pages :as pages]
|
2018-11-14 20:49:17 +00:00
|
|
|
[clojure.test :refer [deftest testing is are]]))
|
2016-09-24 08:28:13 +00:00
|
|
|
|
2018-11-14 20:49:17 +00:00
|
|
|
(deftest prose-comma-list
|
|
|
|
(testing "prose-comma-list turns a list of strings into a prose list"
|
|
|
|
(are [call result] (= call result)
|
|
|
|
(pages/prose-comma-list ["foo"]) "foo"
|
|
|
|
(pages/prose-comma-list ["foo" "bar"]) "foo and bar"
|
|
|
|
(pages/prose-comma-list ["foo" "bar" "baz"]) "foo, bar, and baz"
|
|
|
|
(pages/prose-comma-list ["foo" "bar" "baz" "bobble"]) "foo, bar, baz, and bobble"
|
|
|
|
(pages/prose-comma-list []) "")))
|