Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Maintain 1.2.X compatibility, which is silly.

  • Loading branch information...
commit 8827c8b61e9722b475aadbdcd050e03f4b6e35c5 1 parent f4a3756
@marick authored
View
24 HISTORY.md
@@ -1,22 +1,18 @@
1.5-alpha3
-* The `has` collection predicate now works with collection
- and chatty checkers.
-* We no longer support Clojure 1.2.0. (1.2.1 still works.)
-* midje.repl namespace created.
-* The :check-only-at-load-time metadata was added.
-* `midje-help` and `midje-repl-help` added.
+* midje.repl namespace created (does not work for
+ Clojure 1.2.X)
+* Now reads ~/.midje.clj and .midje.clj for configuration.
+ Configuration keys: :print-level, :visible-deprecation,
+ :visible-future, :check-after-creation, :partial-prerequisites,
+* Doc strings that explain the repl, midje, major topics.
+
* In failures, maps and sets are printed in sort order,
which allows easier comparison of actual to expected
results.
-* Now reads ~/.midje.clj and .midje.clj for configuration.
-* :print-level can be set in the configuration.
-* :visible-deprecation can be set in the configuration.
-* :partial-prerequisites can be set in the configuration.
-* :visible-future can be set in the configuration.
-* :check-after-creation can be set in the configuration.
-* `load-facts` now prevents facts from being created if they're
- excluded by the argument list.
+* The `has` collection predicate now works with collection
+ and chatty checkers.
+* The :check-only-at-load-time metadata was added.
1.5-alpha2
-------------
View
2  Rakefile
@@ -42,5 +42,5 @@ end
desc "Check many versions of Clojure"
task :compatibility do
- doit("lein with-profile 1.2.1:1.3:1.4:1.5 midje")
+ doit("lein with-profile 1.2.0:1.2.1:1.3:1.4:1.5 midje")
end
View
9 src/midje/repl.clj
@@ -11,9 +11,14 @@
[midje.doc :as doc]
[midje.config :as config]
[midje.util.form-utils :as form]
+ [midje.util.colorize :as color]
[midje.util.ecosystem :as ecosystem]
[midje.util.namespace :as namespace]))
+(when (and (ecosystem/running-in-repl?) (ecosystem/clojure-1-2-X?))
+ (println (color/fail "The Midje repl tools don't work on Clojure 1.2.X")))
+(ecosystem/when-1-3+
+
;; Supply function to leiningen.core.project.
;; Note that it does not work to put the following code into
;; midje.util.backwards-compatible-utils.
@@ -26,10 +31,8 @@
([msg map cause]
(RuntimeException. msg cause))))
(in-ns 'midje.repl)
-
(require '[leiningen.core.project :as project])
-
(namespace/immigrate-from 'midje.ideas.metadata
(map metadata/metadata-function-name
metadata/fact-properties))
@@ -329,3 +332,5 @@
(def ^{:doc "Synonym for `recheck-fact`."} rcf recheck-fact)
+
+)
View
4 src/midje/util/ecosystem.clj
@@ -9,6 +9,10 @@
(and (= 1 (:major *clojure-version*))
(= 3 (:minor *clojure-version*))))
+(defn clojure-1-2-X? []
+ (and (= 1 (:major *clojure-version*))
+ (= 2 (:minor *clojure-version*))))
+
(defn clojure-1-2-0? []
(and (= 1 (:major *clojure-version*))
(= 2 (:minor *clojure-version*))
View
6 test/midje/internal_ideas/t_compendium.clj
@@ -4,7 +4,11 @@
[midje.test-util]
[midje.internal-ideas.compendium]
[midje.ideas.metadata :only [fact-name fact-source fact-body-source]])
- (:import midje.internal_ideas.compendium.Compendium))
+ (:require [midje.util.ecosystem :as ecosystem]))
+
+(if (ecosystem/clojure-1-2-0?)
+ (import 'midje.internal-ideas.compendium.Compendium)
+ (import 'midje.internal_ideas.compendium.Compendium))
;; Some faux facts to use in tests
View
5 test/midje/t_repl.clj
@@ -7,7 +7,11 @@
[midje.ideas.reporting.levels :as levelly]
[midje.ideas.reporting.level-defs :as deflevels]
[midje.config :as config]
+ [midje.util.ecosystem :as ecosystem]
midje.util))
+
+(ecosystem/when-1-3+
+
(midje.util/expose-testables midje.repl)
;;;; === Util
@@ -600,3 +604,4 @@
) ; confirming-cumulative-totals-not-stepped-on
+)
View
21 test/midje/t_sweet.clj
@@ -6,6 +6,7 @@
[midje.clojure-test-facade :as ctf]
[midje.repl :as repl]
[midje.config :as config]
+ [midje.util.ecosystem :as ecosystem]
[midje.ideas.metadata :as metadata]))
@@ -427,6 +428,8 @@
;;; fact groups
+
+
(def integration-run-count (atom 0))
(def not-integration-run-count (atom 0))
@@ -437,11 +440,13 @@
(fact no-integration {:integration false}
(swap! not-integration-run-count inc)))
-(ctf/ignoring-counter-changes
- ;; Don't step on the running count up to this point.
- (repl/check-facts *ns* :print-no-summary :integration))
-
-(fact
- :check-only-at-load-time
- @integration-run-count => 2
- @not-integration-run-count => 1)
+(ecosystem/when-1-3+
+ (ctf/ignoring-counter-changes
+ ;; Don't step on the running count up to this point.
+ (repl/check-facts *ns* :print-no-summary :integration))
+
+ (fact
+ :check-only-at-load-time
+ @integration-run-count => 2
+ @not-integration-run-count => 1)
+)
Please sign in to comment.
Something went wrong with that request. Please try again.