testthat 0.8 (and 0.8.1)

February 25, 2014

(This article was first published on RStudio Blog, and kindly contributed to R-bloggers)

We’re pleased to announce a new major version of testthat. Version 0.8 comes with a new recommended structure for storing your tests. To better meet CRAN recommended practices, we now recommend that tests live in tests/testthat, instead of inst/tests. This makes it possible for users to choose whether or not to install tests. With this new structure, you’ll need to use test_check() instead of test_packages() in the test file (usually tests/testthat.R) that runs all testthat unit tests.

Another big improvement comes from Karl Forner. He contributed code which provides line numbers in test errors so you can see exactly where the problems are. There are also four new expectations (expect_null(), expected_named(), expect_more_than(), expect_less_than()) and many other minor improvements and bug fixes. For a complete list of changes, please see the github release. After release of 0.8 to CRAN, we discovered two small bugs. These were fixed in 0.8.1.

As always, you can install the latest version with install.packages("testthat").

To leave a comment for the author, please follow the link and comment on their blog: RStudio Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)