This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

the most well maintained, deprecated, code in the world

- tests should be ran in the test context
  • Loading branch information...
lancepantz committed Jan 24, 2012
1 parent bb79ef9 commit 34ee61ccf862735c5bea0c195b3127a588b1ed46
Showing with 14 additions and 15 deletions.
  1. +12 −11 dev/bake/test.clj
  2. +2 −4 src/cake/tasks/test.clj
View
@@ -3,7 +3,7 @@
[clojure.walk :only [postwalk]]
[clojure.string :only [trim-newline]]
[cake :only [*config*]]
- [bake.core :only [verbose? log all with-timing]]
+ [bake.core :only [verbose? log all with-timing with-context]]
[bake.reload :only [last-reloaded last-modified reload]]
[bake.notify :only [notify]]
[bake.clj-stacktrace])
@@ -87,13 +87,14 @@
*report-counters* (ref *initial-report-counters*)
*ns-results* (atom {})
*current-test* nil]
- (with-timing
- (if (= '(test-ns-hook) tests)
- ((var-get (ns-resolve ns 'test-ns-hook)))
- (once-fixtures
- (fn []
- (doseq [test tests]
- (each-fixtures
- (fn []
- (test-var (ns-resolve ns test))))))))
- @*ns-results*))))
+ (with-context :test
+ (with-timing
+ (if (= '(test-ns-hook) tests)
+ ((var-get (ns-resolve ns 'test-ns-hook)))
+ (once-fixtures
+ (fn []
+ (doseq [test tests]
+ (each-fixtures
+ (fn []
+ (test-var (ns-resolve ns test))))))))
+ @*ns-results*)))))
View
@@ -2,7 +2,7 @@
(:use cake cake.core
[cake.file :only [file]]
[cake.classloader :only [reload-test-classes with-test-classloader]]
- [bake.core :only [in-project-classloader? with-timing]]
+ [bake.core :only [with-timing]]
[bake.find-namespaces :only [find-namespaces-in-dir]]
[useful.utils :only [adjoin]]
[useful.map :only [map-vals]]
@@ -163,9 +163,7 @@
[opts]
(println)
(with-test-classloader
- (bake-ns (:use bake.test clojure.test
- [clojure.string :only [join]]
- [bake.core :only [with-context in-project-classloader?]])
+ (bake-ns (:use bake.test)
(let [[count real-time] (with-timing
(reduce report-and-aggregate {}
(for [[ns tests] (test-vars opts) :when (seq tests)]

0 comments on commit 34ee61c

Please sign in to comment.