I want to write unit test cases for my plugins written in ruby

I am using rspec library for unit testing. Is there a way to get the context.registers (site , pages) so that they can be passed to individual functions.