about summary refs log tree commit diff
path: root/test/pronouns/pages_test.clj
diff options
context:
space:
mode:
Diffstat (limited to 'test/pronouns/pages_test.clj')
-rw-r--r--test/pronouns/pages_test.clj10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/pronouns/pages_test.clj b/test/pronouns/pages_test.clj
new file mode 100644
index 0000000..04c14ce
--- /dev/null
+++ b/test/pronouns/pages_test.clj
@@ -0,0 +1,10 @@
+(ns pronouns.pages-test
+  (:require [pronouns.pages :as pages]
+            [midje.sweet :refer :all]))
+
+(fact "prose-comma-list turns a list of strings into a prose list with commas"
+      (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 []) => "")