tags:

views:

29

answers:

1

checkException will validate if meeting a stop() call, but not a warning() call. Is there a workaround or hack to check for warnings? (and make them silent during testing)

thanks

+4  A: 

Maybe you can simply use

> options(warn=2)

in the setup code to turn warnings into errors?

See help(options) for the paragraph on this option.

Dirk Eddelbuettel
yes that will do the trick... but I guess I'll need to run tests that are supposed make warnings twice: once with options(warn=2) while checking that they make an error, and once with options(warn=1) while checking that they do not.Thanks!
Yannick Wurm