Releases: clojure-expectations/expectations
Release 2.1.10
This is a maintenance release of Expectations that add two new helper functions for expectations:
approximately
--(approximately 42.0)
returns a predicate that will test if its argument is "close" to42.0
; by default, that closeness is within0.001
but you can callapproximately
with two arguments to provide a different delta value.functionally
--(functionally f1 f2)
returns a predicate that will test if(f1 arg)
is equal to(f2 arg)
; you can optionally provide a third argument that can be invoked with the two different results and should return a string explaining how/why they are different (the default is to just say"not functionally equivalent"
).
In addition, a number of bugs in ClojureScript support were fixed.
2.2.0 RC 3
Restores most of Expectations' explanatory test output on top of clojure.test
(by synthesizing an elaborate :message
value). Still needs list failure handling added from in
tests.
Improves line number reporting by implementing expect
as a macro directly in expectations.clojure.test
-- this is a potentially breaking change depending on how you are using this namespace:
- If you are
:refer
ring:all
, you'll pick up the newexpect
macro automatically. - If you are also
:refer
ring:all
ofexpectations
as well, that will break -- but all public symbols fromexpectations
are now available inexpectations.clojure.test
so you no longer needexpectations
at all. - If you are
:refer
ring in justdefexpect
, you'll need to addexpect
as well.
2.2.0 RC 2
Reimplement clojure.test
compatibility on top of do-report
instead of report
to support test harnesses that monkey patch the former (such as Cursive).
Cursive test integration now shows pass/fail in the editor. You cannot yet "run test under caret".
I hope to address the line numbering issue before "gold" release.
2.2.0 RC 1
Adds new expecting
macro, based on clojure.test/testing
to help make tests more descriptive.
2.2.0 Beta 3
Adds the ability to generate a readme.clj
test file from a specified README file.
Specify the system property expectations.readme
or the environment variable EXPECTATIONS_README
to identify the README file -- in project.clj
, you'll see examples.md
identified via the system property.
Optionally specify the output folder via the system property expectations.test.path
or the environment variable EXPECTATIONS_TEST_PATH
. It defaults to test
-- in project.clj
, you'll see test/clojure
identified via the system property.
If the README file is newer than readme.clj
in the output folder -- or the latter does not exist -- then Expectations will generate readme.clj
from that file, maintaining line numbers (hopefully!), and then require
the new test file (so that it is run as part of the test suite). If readme.clj
is newer, it will just be treated as a normal test file.
A new expectations/readme
function has been added with can be invoked by tooling with the file path of the input (README) file and the folder path where readme.clj
should be written. If this function is invoked with no arguments -- which happens when the expectations
namespace is loaded! -- it uses the system properties and environment variables (above) to determine the input file path and output file path.
2.2.0 Beta 2
Rewrote the defexpect
expansion of expect
forms to allow nested use and other, non-expect
code per #90.
2.2.0 Beta 1
Adds functionally
predicate #88 and cleans up readme/changelog. The clojure.test
support is working well at World Singles so I'd like it to get more widespread usage now as a Beta.
2.2.0 Alpha 1
Adds expectations.clojure.test
namespace and support for clojure.test
tooling. See https://clojure-expectations.github.io/clojure-test.html for details.