Skip to content

Commit

Permalink
Add (change-defaults :run-clojure-test false)
Browse files Browse the repository at this point in the history
  • Loading branch information
marick committed Jan 22, 2016
1 parent e12a19a commit e2fbdcd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions .midje.clj
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
(change-defaults :visible-deprecation false)
; (change-defaults :run-clojure-test false)
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
This project adheres to [Semantic Versioning](http://semver.org/).
See [here](http://keepachangelog.com/) for the change log format.

## [1.8.4-SNAPSHOT]
## [1.9.0-SNAPSHOT]

- Experimental version from @dlebrero that unloads deleted namespaces.
- Experimental version from @dlebrero that unloads deleted namespaces.
- `(change-defaults :run-clojure-test false)` prevents clojure.test tests from being run.
- NOTE NOTE NOTE: Previous should be documented before 1.9.0 is released.

## [1.8.3]
- Bump to newer versions of dependencies
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject midje "1.8.4-SNAPSHOT"
(defproject midje "1.9.0-SNAPSHOT"
:description "A TDD library for Clojure that supports top-down ('mockish') TDD, encourages readable tests, provides a smooth migration path from clojure.test, balances abstraction and concreteness, and strives for graciousness."
:url "https://github.com/marick/Midje"
:pedantic? :warn
Expand Down
1 change: 1 addition & 0 deletions src/midje/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
:visible-failure-namespace false
:partial-prerequisites false
:check-after-creation true
:run-clojure-test true
:emitter 'midje.emission.plugins.default
:check-recorder (fn [checkable-map prerequisite-maps])
:fact-filter (constantly true)})
Expand Down
13 changes: 10 additions & 3 deletions src/midje/emission/clojure_test_facade.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
facade shows how."}
midje.emission.clojure-test-facade
(:require [clojure.test :as ct]
[midje.config :as config]
[clojure.string :as str]))

;; This turns off "Testing ...." lines, which I hate, especially
Expand All @@ -21,9 +22,15 @@
affect the Midje fact counters but instead returns a map
that can be used to produce a separate report."
[namespaces]
(binding [ct/*test-out* (java.io.StringWriter.)]
(assoc (apply ct/run-tests namespaces)
:lines (-> ct/*test-out* .toString str/split-lines))))
;; Kind of kludgy: if clojure.test is turned off, run it on
;; no namespaces. That isolates the caller from knowing what
;; was tested with clojure.test.
(let [namespaces-to-run (if (config/choice :run-clojure-test)
namespaces
[])]
(binding [ct/*test-out* (java.io.StringWriter.)]
(assoc (apply ct/run-tests namespaces-to-run)
:lines (-> ct/*test-out* .toString str/split-lines)))))

(defn forget-failures
"This can only be used within the dynamic scope of run-tests."
Expand Down

0 comments on commit e2fbdcd

Please sign in to comment.