- BDD: testhat now comes with an initial behaviour driven development (BDD)
BDD tests read like sentences, so they should make it easier to understand
the specification of a function. See
?describe()for further information
- It's now possible to
skip()a test with an informative message - this is
useful when tests are only available under certain conditions, as when
not on CRAN, or when an internet connection is available (#141).
skip_on_cran()allows you to skip tests when run on CRAN. To take advantage
of this code, you'll need either to use devtools, or run
Sys.setenv(NOT_CRAN = "true"))
- Simple mocking:
with_mock()makes it easy to temporarily replace
functions defined in packages. This is useful for testing code that relies
on functions that are slow, have unintended side effects or access resources
that may not be available when testing (#159, @krlmlr).
- A new expectation,
expect_equal_to_reference()has been added. It
tests for equality to a reference value stored in a file (#148, @jonclayden).
Minor improvements and bug fixes
auto_test_package()works once more, and now uses
for higher fidelity loading (#138, #151).
- Bug in
compare.character()fixed, as reported by Georgi Boshnakov.
colourise()now uses option
TRUE). If it
FALSE, output is not colourised (#153, @mbojan).
all.equal()to generate an informative
error message if the two objects are not identical (#165).
safe_digest()uses a better strategy, and returns NA for directories
- Random praise is renabled by default (again!) (#164).
- Teamcity reporter now correctly escapes output messages (#150, @windelinckx).
It also uses nested suites to include test names.
library_if_available()has been deprecated.