Learn R Programming

testthat (version 0.2)

prints_text: Expectation: does printed output match a regular expression?

Description

Expectation: does printed output match a regular expression?

Usage

prints_text(regexp, ...)

Arguments

regexp
regular expression to test against
...
other arguments passed to grepl

Examples

Run this code
str(mtcars)
expect_that(str(mtcars), prints_text("32 obs"))
expect_that(str(mtcars), prints_text("11 variables"))

Run the code above in your browser using DataLab