Skip to content

Commit

Permalink
Flatten test namespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
duelinmarkers committed Aug 18, 2009
1 parent 3ff853a commit faf5a68
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<target name="test" depends="compile">
<java classname="clojure.main" classpathref="test.classpath" dir="${test.dir}" fork="true" failonerror="true">
<arg value="-e" />
<arg value="(require 'clj-record.test.main) (clj-record.test.main/load-and-run)" />
<arg value="(require 'clj-record.main) (clj-record.main/load-and-run)" />
</java>
</target>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(ns clj-record.test.associations-test
(ns clj-record.associations-test
(:require
[clj-record.test.model.manufacturer :as manufacturer]
[clj-record.test.model.product :as product])
[clj-record.test-model.manufacturer :as manufacturer]
[clj-record.test-model.product :as product])
(:use clojure.contrib.test-is
clj-record.test.test-helper))
clj-record.test-helper))


(defdbtest belongs-to-creates-find-function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-record.test.callbacks-built-ins-test
(ns clj-record.callbacks-built-ins-test
(:use clojure.contrib.test-is)
(:require [clj-record.callbacks.built-ins :as cbfunc]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(ns clj-record.test.callbacks-test
(ns clj-record.callbacks-test
(:require
[clj-record.test.model.manufacturer :as manufacturer]
[clj-record.test-model.manufacturer :as manufacturer]
[clj-record.callbacks :as callbacks])
(:use clojure.contrib.test-is
clj-record.test.test-helper))
clj-record.test-helper))


(defdbtest before-save-can-transform-the-record-before-create
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(ns clj-record.test.core-test
(ns clj-record.core-test
(:require
[clj-record.core :as core]
[clj-record.query :as query]
[clj-record.test.model.manufacturer :as manufacturer]
[clj-record.test.model.product :as product])
[clj-record.test-model.manufacturer :as manufacturer]
[clj-record.test-model.product :as product])
(:use clojure.contrib.test-is
clj-record.test.test-helper))
clj-record.test-helper))


(deftest table-name-can-be-unconventional-with-table-name-option-to-init-model
Expand Down
6 changes: 3 additions & 3 deletions test/clj_record/test/main.clj → test/clj_record/main.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns clj-record.test.main
(ns clj-record.main
(:require [clojure.contrib.sql :as sql]
[clojure.contrib.test-is :as test-is])
(:use clj-record.test.model.config
(:use clj-record.test-model.config
clojure.contrib.str-utils))


Expand Down Expand Up @@ -41,7 +41,7 @@
"Resets the test database, then finds, loads, and runs all the tests."
[]
(reset-db)
(let [test-files (for [f (.listFiles (java.io.File. "clj_record/test"))
(let [test-files (for [f (.listFiles (java.io.File. "clj_record"))
:when (re-find #"test.clj$" (.getPath f))]
(re-find #"[^.]+" (.getPath f)))
test-namespaces (map #(symbol (re-gsub #"/" "." (re-gsub #"_" "-" %))) test-files)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(ns clj-record.test.query-test
(ns clj-record.query-test
(:require
[clj-record.core :as core]
[clj-record.query :as query]
[clj-record.test.model.manufacturer :as manufacturer]
[clj-record.test.model.product :as product])
[clj-record.test-model.manufacturer :as manufacturer]
[clj-record.test-model.product :as product])
(:use clojure.contrib.test-is
clj-record.test.test-helper))
clj-record.test-helper))


(defn manufacturers []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(ns clj-record.test.serialization-test
(ns clj-record.serialization-test
(:require
[clj-record.serialization :as serialization]
[clj-record.test.model.manufacturer :as manufacturer])
[clj-record.test-model.manufacturer :as manufacturer])
(:use clojure.contrib.test-is
clj-record.test.test-helper))
clj-record.test-helper))


(deftest serializes-simple-clojure-types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-record.test.test-helper
(ns clj-record.test-helper
(:require [clj-record.core :as core])
(:use clojure.contrib.test-is))

Expand All @@ -8,7 +8,7 @@
(rolling-back ~@body)))

(defmacro rolling-back [& body]
`(core/transaction clj-record.test.model.config/db
`(core/transaction clj-record.test-model.config/db
(try
~@body
(finally
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-record.test.model.config)
(ns clj-record.test-model.config)

(comment)
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns clj-record.test.model.manufacturer
(ns clj-record.test-model.manufacturer
(:require clj-record.boot
[clj-record.validation.built-ins :as valid]
[clj-record.callbacks.built-ins :as cb])
(:use clj-record.test.model.config))
(:use clj-record.test-model.config))


; def'd here to illustrate that validation messages don't have to live inline in the init-model form.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns clj-record.test.model.product
(ns clj-record.test-model.product
(:require clj-record.boot)
(:use clj-record.test.model.config))
(:use clj-record.test-model.config))


(clj-record.core/init-model
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-record.test.util-test
(ns clj-record.util-test
(:require
[clj-record.util :as util])
(:use clojure.contrib.test-is))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns clj-record.test.validation-built-ins-test
(ns clj-record.validation-built-ins-test
(:use clojure.contrib.test-is)
(:require [clj-record.validation.built-ins :as v]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns clj-record.test.validation-test
(ns clj-record.validation-test
(:require
[clj-record.validation :as validation]
[clj-record.test.model.manufacturer :as manufacturer]
[clj-record.test.model.product :as product])
[clj-record.test-model.manufacturer :as manufacturer]
[clj-record.test-model.product :as product])
(:use clojure.contrib.test-is))


Expand Down

0 comments on commit faf5a68

Please sign in to comment.