Skip to content
Prev 115405 / 398498 Next

Unit Testing Frameworks: summary and brief discussion

Oops, taking a look at the unit tests in RUnit, I see that specifying
'where=.GlobalEnv' is what I had been missing.

testCreateClass <- function() {
    setClass("A", contains="numeric", where=.GlobalEnv)
    a=new("A")
    checkTrue(validObject(a))
    removeClass("A", where=.GlobalEnv)
    checkException(new("A"))
}

Executing test function testCreateClass  ...  done successfully.

RUNIT TEST PROTOCOL -- Wed May  9 11:11:27 2007 
*********************************************** 
Number of test functions: 1 
Number of errors: 0 
Number of failures: 0 

Sorry for the noise. Martin

Martin Morgan <mtmorgan at fhcrc.org> writes: