Fix test to avoid printing message

The recent release of testthat now displays messages in test blocks, which revealed that
this test needed to be updated.