0

I am writing an app in Corona and coming from a TDD background I wanted to write some unit tests for it. I installed busted via luarocks and most stuff seems to be working fine(wrote a couple small modules and test suites for each one). I begin to run into issues when the module I am testing requires a Corona library like storyboard, which results in the error "module 'storyboard' not found"

Does anyone Corona TDD experience have any suggestions? Perhaps a directory containing the Corona modules is in the Lua search path?

Thanks in advance!

Thomas W
  • 14,757
  • 6
  • 48
  • 67
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
  • Is your `LUA_PATH` environment variable set properly? – Ryan Stein Jan 06 '14 at 15:59
  • @RyanStein it is set. Not sure if it is set correctly though. Everything else loads fine. Strange that the `storyboard` module is required just fine in my `main.lua`(when I run the app via the simulator). – Stratus3D Jan 06 '14 at 16:25
  • Does `LUA_PATH` include the path of Corona's libraries? Something like `./?.lua;/path/to/Corona/?.lua`. I'm assuming the simulator automatically includes that path before running. – Ryan Stein Jan 06 '14 at 16:30

1 Answers1

0

Check this out: https://github.com/chris-allnutt/unit-tested-corona

You can find a working example there.

I personally had problems installing busted, so I went with LunaTest instead and things are working great with Corona: LunaTest and Corona

Jose Llausas
  • 3,366
  • 1
  • 20
  • 24
  • I didn't see any examples in that repo that were using the storyboard module. Can you provide an example? – Stratus3D Jun 11 '14 at 20:00
  • Are you running the code with Corona Simulator or Lua interpreter? I personally had lots of problems with busted and corona working together, so I decided to use Luna Test instead and things are going great! LunaTest and corona Tutorial here: http://jessewarden.com/2012/07/unit-testing-in-corona-sdk-using-lunatest.html – Jose Llausas Jun 11 '14 at 20:05