From 878f6ccae924c4646e772ce833b401215ac6674e Mon Sep 17 00:00:00 2001 From: Timothy Washington Date: Sun, 3 Oct 2010 12:26:40 -0400 Subject: [PATCH] -- working :once and :each fixtures for login_test.clj --- test/login_test.clj | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/test/login_test.clj b/test/login_test.clj index c7f436f..7fc1385 100644 --- a/test/login_test.clj +++ b/test/login_test.clj @@ -1,15 +1,23 @@ (ns login-test - (:use [helpers] :reload-all) - (:use [clojure.test]) - (:use [depth_adapter]) - (:require [bkell]) - - (:import java.io.ByteArrayInputStream) - (:require clojure.contrib.str-utils) - (:require commands.add) + ;;(:use [helpers] :reload-all) + ;;(:use [depth_adapter]) + ;;(:require [bkell]) + + ;;(:use [clojure.test]) + ;;(:import java.io.ByteArrayInputStream) + ;;(:require clojure.contrib.str-utils) + ;;(:require commands.add) ) +(use 'helpers ) +(use 'depth_adapter) +(require 'bkell) + +(use 'clojure.test) +(import 'java.io.ByteArrayInputStream) +(require 'clojure.contrib.str-utils) +(require 'commands.add) (def configs (load-file "etc/config/config.test.clj")) @@ -19,12 +27,16 @@ "Initialize the shell" [test] + (println "test-fixture-shell CALLED") (bkell/init-shell) + + (test) ) (defn test-fixture-db "test to clear out shell memory before a test is run" [test] + (println "test-fixture-db CALLED") ;; make the shell active (dosync (alter bkell/shell conj @@ -43,8 +55,8 @@ ) -(use-fixtures :once test-fixture-shell) -(use-fixtures :each test-fixture-db) +(use-fixtures :once login-test/test-fixture-shell ) +(use-fixtures :each login-test/test-fixture-db ) ;; test basic login (deftest test-login [] @@ -56,18 +68,21 @@ ;; test result when already logged in (deftest test-existing-login [] + (is (= 5 5)) ) ;; test a login with a bad password (deftest test-bad-password [] + (is (= 5 5)) ) ;; test logging out (deftest test-logout [] + (is (= 5 5)) ) -- 2.11.4.GIT