el-mock.el
el-mock.el copied to clipboard
Mock functions with many (or unknown number of) parameters
When a function takes many parameters, using mock
may require passing many stars *
which is inconvenient. When a function takes an unknown number of parameters, things get worse (e.g., mocking message
or call-process
). Would it make sense to let (mock (message *))
mean "any call to message with at least 1 parameter" ? More generally, (mock (FUNC arg1 arg2 ... argn))
could mean "any call to FUNC with first n
arguments matching arg(i) and potentially more unconstrained arguments".
Would pcase
be of any help?
Perhaps, maybe we could add a **
parameter to mock for these cases.