Mercurial > lasercutter
view src/clojure/contrib/test_contrib/test_with_ns.clj @ 10:ef7dbbd6452c
added clojure source goodness
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 21 Aug 2010 06:25:44 -0400 |
parents | |
children |
line wrap: on
line source
1 (ns clojure.contrib.test-with-ns2 (:use clojure.test3 clojure.contrib.with-ns))5 (deftest test-namespace-gets-removed6 (let [all-ns-names (fn [] (map #(.name %) (all-ns)))]7 (testing "unexceptional return"8 (let [ns-name (with-temp-ns (ns-name *ns*))]9 (is (not (some #{ns-name} (all-ns-names))))))10 (testing "when an exception is thrown"11 (let [ns-name-str12 (try13 (with-temp-ns14 (throw (RuntimeException. (str (ns-name *ns*)))))15 (catch clojure.lang.Compiler$CompilerException e16 (-> e .getCause .getMessage)))]17 (is (re-find #"^sym.*$" ns-name-str))18 (is (not (some #{(symbol ns-name-str)} (all-ns-names))))))))