testdat 0.4.2

testdat 0.4.1

expect_all(everything(), is.numeric, data = iris):
#> Error: `iris` has 150 records failing  `is.numeric` on variable `Species`.
#>  Vars: everything()
#>  Filter: None
#>  Arguments: `` 

expect_all() sits behind many other expectations, which will also see a change to their failure message.

testdat 0.4.0

mtcars %E>%
  expect_base(mpg, TRUE) %>%
  mutate(mpg = NA) %E>%
  expect_base(mpg, FALSE)

This is a shorthand way of piping into the with_testdata() function.

mtcars %>%
  with_testdata(expect_base(mpg, TRUE)) %>%
  mutate(mpg = NA) %>%
  with_testdata(expect_base(mpg, FALSE))

testdat 0.3.0

Breaking changes

tidyselect (#36)

As of testdat 0.3.0 we have moved to the tidyselect framework for variable selections instead of dplyr::vars(). tidyselect is the successor to vars() - it’s a bit cleaner, provides some nifty features like selecting columns with a predicate function using where() and finally allows us to get rid of the distinction between multi and single variable expectations.

Unfortunately this will break some code, but it’s horrendously difficult to support both methods and it’s best to switch before publishing to CRAN. Fortunately it’s a simple fix - anywhere that you are currently using vars(), replace it with c():

# Old
expect_unique(vars(x, y))
# New
expect_unique(c(x, y))

The affected expectations are:

A small number of functions have been hard deprecated as they are now redundant:

Auto-generated expectations have also changed slightly - previously they could either accept a single unquoted variable name or a group of variables specified with vars(). They now always accept multiple columns using tidyselect syntax. As a result, the name of the first argument for these expect has changed from var to vars, so be careful if you’re using this as a named argument.

tidyselect syntax allows single unquoted variable names as well as arbitrary groups of variable specifications, and all of the auto-generated expectations in the package used the single variable variant so this shouldn’t break existing code.

These are all valid column specifications using tidyselect:

expect_values(a, 1:10)
expect_values(c(a, b), 1:10)
expect_values(a:c, 1:10)
expect_values(matches("^[ab]$"), 1:10)
expect_values(c(matches("^[ab]$"), c), 1:10)
expect_values(where(is.numeric), 1:10)

Others

Deprecations

Bug fixes / minor updates

testdat 0.2.0

In addition to minor updates and bug fixes, this release does three main things: * Behind the scenes, it (a) reorganises and refactors the code base to reduce redundancies and improve clarity, and (b) significantly builds out the testing infrastructure. * On the wings, it expands the documentation for existing functions considerably. * At centre stage, it extends the expect_*() framework, e.g. by introducing ‘fuzzy’ expectations in the form of expect_prop_*().

Breaking changes

Deprecations

Additions

Bug fixes

Other minor changes

testdat 0.1.0

Initial release.

Major changes from early development releases

Minor changes