# How to mock @context.registers for writing unit testing

**URL:** <https://talk.jekyllrb.com/t/how-to-mock-context-registers-for-writing-unit-testing/7247>\
**Category:** Help\
**Created:** [April 19, 2022, 1:09pm UTC](https://talk.jekyllrb.com/t/how-to-mock-context-registers-for-writing-unit-testing/7247 "2022-04-19T13:09:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishank](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@rishank](https://talk.jekyllrb.com/u/rishank)\
**Post date:** [April 19, 2022, 1:09pm UTC](https://talk.jekyllrb.com/t/how-to-mock-context-registers-for-writing-unit-testing/7247/1 "2022-04-19T13:09:46Z")

</div>

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?
