is it possible to mock out and test macros? For example, let's say I would like to mock and test the or
macro. Is this possible?
You can test a macro with eval
. Otherwise it will have executed before your test runs.
I'm guessing mocking won't work, because if your code is in another namespace, it will have already expanded the macro by test time, and rebinding the macro won't cause it to re-expand.
You might be able to jury-rig something to reload the dependent namespace every time you rebind the macro, but that seems like it might be really flakey.
I see ok thank you. I'm guessing another way would be to wrap the macro around a function and mock that