0.8.0 (2024-08-30)
- calling-macros: use keyword argument for clear (a4a3a3d)
- mock: allow sharing history between bydi forms (4409d4a)
- volatile: allow sharing volatility (e69c82d)
0.7.0 (2024-03-01)
- mock: add keyword :var (fe2d75c)
0.6.5 (2024-01-27)
- ci: release job (5f30a1d)
- Keyword
:fail
can be used to have a function fail. By default it usessignal
passing'(error "Lisp error")
but what is used can be set using:with
and what is passed using:args
.
bydi-when
now uses keywords. This is a breaking change.
bydi-mock--volatile
no longer returns the resut ofmemq
which can mess up tests. Instead it returnst
ornil
.g
- Macro
bydi-when
that allows selectively returning mock values for function that are spied upon with:spy
.
- Volatile functions (using
:sometimes
or:othertimes
) now can be individually toggled usingbydi-toggle-volatile
.
bydi-toggle-sometimes
now only clears mocks for functions using:sometimes
or:othertimes
.
- Submodules
bydi-ci
andbydi-report
were removed since they now are part ofdinghy
asdinghy-rope
.
- Function
bydi-report-setup-ert
that accepts key:increase-print-depth
to do just that.
bydi-ci
now requiresbydi
andbydi
requiresert
.- The explainer for
bydi-match-expansion
now shows actual value as actual and expected as expected.
- Command
bydi-report-find-test-helper
to find the test helperert-runner
uses. - Explainers for
bydi-was{-not}-called
andbydi-was{-not}-called
should be more useful now.
- The package name in the Makefile.
- The execution of
bydi
is now wrapped by special formunwind-protect
to avoid a faulty test from breaking other tests.
- Explainer for
bydi-matches-expansion
includes the expanded form.
- Macros
bydi-was-called{-with}
now accept an optional {second,third} argument to clear the mocks for that very function. - Macros
bydi-was-set{-to}
now accept optional {second,third} argument to clear the assignments to that very variable.
- Shorthand
:othertimes
that will returnnil
when:sometimes
would returnt
. bydi-was-set-to{-nth}
now also works forlet
bindings. These two as well asbydi-was{-not}-set
have explainers.
- Variables can now be watched using
:watch
and inspected using aliasesbydi-was-set
,bydi-was-set-to
etc. bydi-was-called-with
now supports matching with elided arguments.- Warnings about risky mocks can be silenced by using
:risky-mock
instead of:mock
. - Macros now use
ert--explain-equal-rec
on failure to provide more information.
bydi-clear-mocks
now usesclrhash
instead of creating a new hash table.
- Passing a single argument to
bydi-was-called-{nth-}with
should now work reliably.
- Macro
bydi-was-called-last-with
as a convenience function to get the last result.
- Macro
bydi-match-expansion
now has its ownert-explainer
to show the mismatch between actual and expected expansion. - Switched to using
dinghy
. - Calling
bydi-toggle-sometimes
now automatically callsbydi-clear-mocks
unless it is called witht
to prevent that. - Reporting (
undercover
andert-runner
) were factored out into new packagebydi-report
. bydi-calculate-coverage
has been deprecated. Printing the report and the average is now done automatically for text coverage.bydi-path-setup
was made obsolete bybydi-ci-setup-paths
.
- Self-referential test suite.
- Command
bydi-calculate-coverage
to that using the text report file. - Macro
bydi-with-mock
is now also aliased by justbydi
. bydi
now acceptsplist
s of a certain shape. You can use(:mock fun :return value)
or(:mock fun :with other-fun)
.bydi
now accepts shorthand(:always fun)
and(:ignore fun)
to mock a function withignore
oralways
respectively.bydi
now accepts shorthand(:sometimes fun)
that will have a function returnt
by default ornil
if(bydi-toggle-sometimes)
was called.bydi-was-{not}-called-{n-times, with}
now have an explainer function.bydi
now accepts(:spy fun)
that allows spying on a function without replacing it so it can be used in conjunction withbydi-was-{not}-called-{n-times, with}
.bydi
will now issue warnings if a function belonging tobydi--never-mock
is being mocked.
- Source code was refactored to group functions (sometimes renaming them).
Initial version as an extraction of my config package.