Learn R Programming

testthat (version 0.3)

shows_message: Expectation: does expression show a message?

Description

Expectation: does expression show a message?

Usage

shows_message(regexp)

Arguments

regexp
optional regular expression to match. If not specified, just asserts that expression shows some message.

Details

Needs to match at least one of the messages produced by the expression.

Examples

Run this code
expect_that(message("a"), shows_message())
expect_that(message("a"), shows_message("a"))

Run the code above in your browser using DataLab