Coming from a strong TDD background I was upset when I found that there wasn’t a lot of examples of unit testing the Lua part of Corona so I threw a new one together, using spies and mocks. It’s not a in depth example but Spy’s and mocks were the areas I found missing in other examples I’ve viewed.
For this example I abstracted the Change Text Color Button into its own class and added unit tests for it using Busted. I also mocked the display class and my button because we don’t have access to them in a pure LUA environment.
Please check it out,
https://github.com/chris-allnutt/unit-tested-corona [import]uid: 130806 topic_id: 34533 reply_id: 334533[/import]