Skip to content

Commit

Permalink
fixes #42 by throwing an exception for implicit expect
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Corfield <[email protected]>
  • Loading branch information
seancorfield committed Dec 14, 2024
1 parent a56c19c commit e1ef0b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

Only accretive/fixative changes will be made from now on.

* 2.3.next in progress
* Address [#42](https://github.com/clojure-expectations/clojure-test/issues/42) by removing support for the implicit `expect` form of `defexpect`. This was deprecated in 2.2.214. In 2.3.next, an exception is thrown.
* Updated dev/test dependencies.

* 2.2.214 -- 2024-12-13
* Address [#41](https://github.com/clojure-expectations/clojure-test/issues/41) by deprecating the implicit `expect` form of `defexpect` and printing an obnoxious warning when it is used. This form of `defexpect` will be removed in a future release!
* PR [#40](https://github.com/clojure-expectations/clojure-test/pull/40) [@NoahTheDuke](https://github.com/NoahTheDuke) reduces the amount of code generated for `?=` (and, in turn, for `more-of`), allowing for more complex tests.
Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[deps-deploy.deps-deploy :as dd]))

(def lib 'com.github.seancorfield/expectations)
(defn- the-version [patch] (format "2.2.%s" patch))
(defn- the-version [patch] (format "2.3.%s" patch))
(def version (the-version (b/git-count-revs nil)))
(def snapshot (the-version "999-SNAPSHOT"))
(def class-dir "target/classes")
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:deps {org.clojure/clojure {:mvn/version "1.9.0"}}
:aliases
{;; for help: clojure -A:deps -T:build help/doc
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.5"}
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
:ns-default build}

Expand Down
6 changes: 2 additions & 4 deletions src/expectations/clojure/test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,8 @@
[n & body]
(if (and (= (count body) 2)
(not (some contains-expect? body)))
;; treat (defexpect my-name pred (expr)) as a special case
`(t/deftest ~n (do
(println "DEPRECATED: implicit 'expect' in defexpect" '~n)
(expect ~@body)))
(throw (ex-info (str "defexpect " n " should contain at least one 'expect' form")
{:name n, :body body}))
;; #13 match deftest behavior starting in 2.0.0
`(t/deftest ~n ~@body)))

Expand Down

0 comments on commit e1ef0b0

Please sign in to comment.