9mm/lib/keys.test.fnl

14 lines
581 B
Fennel

(let [{: keys} (require :lib.keys)
{: describe :end test-end} (require :lib.test)]
(describe "keys()" (fn [t]
(let [input {:apple :red :banana :yellow}
actual (keys input)
sorted (table.sort actual) ;; SIDE EFFECT!!
]
(t {:given "a table"
:should "returns a list of keys"
:expected [:apple :banana]
: actual})
(test-end)))))