PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lobos/test/utils.clj

http://github.com/budu/lobos
Clojure | 25 lines | 14 code | 4 blank | 7 comment | 0 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
 9(ns lobos.test.utils
10  (:refer-clojure :exclude [defonce])
11  (:use clojure.test
12        lobos.utils))
13
14(deftest test-as-str
15  (are [s] (= s "foo")
16       (as-str :foo)
17       (as-str 'foo)
18       (as-str "foo"))
19  (is (= (as-str :foo 'bar "baz") "foobarbaz")))
20
21(deftest test-as-list
22  (is (= (as-list [:foo :bar :baz]) "(foo, bar, baz)")))
23
24(deftest test-as-sql-keyword
25  (is (= (as-sql-keyword :foo-bar) "FOO BAR")))