summary refs log tree commit diff
path: root/lib/head.test.fnl
blob: 12095990b1b6aac77ff5056243183dcc39bdc964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
(let [{: head} (require :lib.head)
      {: describe :end test-end} (require :lib.test)]
  (describe "head()" (fn [t]
                       (t {:given "a list of elements"
                           :should "returns the first element of a list"
                           :expected :apple
                           :actual  (head [:apple :orange :pear])})
                       (t {:given "an empty list"
                           :should "returns an empty list"
                           :expected 0
                           :actual (length (head []))})
                       (test-end))))