/test/lobos/test/utils.clj

http://github.com/budu/lobos · Clojure · 25 lines · 14 code · 4 blank · 7 comment · 4 complexity · fddd0e76ac12aad6b72b87410e946327 MD5 · raw file

  1. ;; Copyright (c) Nicolas Buduroi. All rights reserved.
  2. ;; The use and distribution terms for this software are covered by the
  3. ;; Eclipse Public License 1.0 which can be found in the file
  4. ;; epl-v10.html at the root of this distribution. By using this software
  5. ;; in any fashion, you are agreeing to be bound by the terms of this
  6. ;; license.
  7. ;; You must not remove this notice, or any other, from this software.
  8. (ns lobos.test.utils
  9. (:refer-clojure :exclude [defonce])
  10. (:use clojure.test
  11. lobos.utils))
  12. (deftest test-as-str
  13. (are [s] (= s "foo")
  14. (as-str :foo)
  15. (as-str 'foo)
  16. (as-str "foo"))
  17. (is (= (as-str :foo 'bar "baz") "foobarbaz")))
  18. (deftest test-as-list
  19. (is (= (as-list [:foo :bar :baz]) "(foo, bar, baz)")))
  20. (deftest test-as-sql-keyword
  21. (is (= (as-sql-keyword :foo-bar) "FOO BAR")))