I am currently trying to go back through and write unit tests for some code that wraps an existing class. The function I am looking for has code that looks like the following...
private OldObject oldObject
...
public Boolean method(){
Boolean returnValue = false
if(oldObject.method(100)){
returnValue = true
}
if(oldObject.method(101)){
returnValue = true
}
}
I have thought about using metaClass, something like OldObject.metaClass.method{return true} but I'm not sure how to remove this before the next tests.
Anyone have best practices/help for this kind of situation?