I'm wanting to write unit tests for an existing lua file using Busted. I want to swap out some of the methods during the test, so that the file runs with the mocked/stubbed methods rather than the real ones (otherwise it will fail). Some of the methods that the file calls are pulled in from other lua-libraries, and I'd like to mock these too.
How can this be achieved?
Any help appreciated, thanks.