13 lines
599 B
Fennel
13 lines
599 B
Fennel
(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))))
|