How to mock @context.registers for writing unit testing

I am using rsepc to test my plugins.
How can i mock global variables (site , page ,layout) , so that these can be passed to functions?