Questions tagged [lua-busted]

busted is a unit testing framework supporting Lua >= 5.1, luajit >= 2.0.0, and moonscript.

24 questions
0
votes
1 answer

unit test for function in lua using busted

I have a file contain multi function and I try to write unit-test for specific function using busted framework code.lua: function myfunc1(a,b) -- do someting return c1 end function myfunc2(a2,b2) -- do someting return…
JACK
  • 65
  • 6
0
votes
0 answers

Nil error when testing Lua code with busted

I am new to using busted testing framework for Lua, but I wrote two tests. Each one works on their own, there are no errors. But when I run them both (e.g. I don't include --exclude-pattern=name_spec.lua), the one that starts later fails with an…
Michael Kročka
  • 617
  • 7
  • 22
0
votes
1 answer

Is there a way to set up a watchdog timer with the Busted testing framework for Lua?

One of the test cases in my test suite triggered a bug in my program which caused it to enter into an infinite loop. This bug also causes the program to consume an unbounded amount of memory so my system quickly starts swapping to disk and becomes…
hugomg
  • 68,213
  • 24
  • 160
  • 246
0
votes
0 answers

Running busted from luarocks - 'busted' is not recognized as an internal or external command

I just started learning Lua (and am pretty new to programming/command line in general) and I am trying to install busted (a testing framework) from luarocks. When I run "luarocks install busted" it says that it is installed, but when I run "busted,"…
Katy
  • 1
0
votes
1 answer

Integrating Busted tests into a Maven build cycle

My recent task at work is to look into integrating some tests we built for our custom Kong API Gateway plugins into our standard Maven build. The build currently just moves configuration scripts to the right place, packages the plugins in such a way…
0
votes
1 answer

Testing code immediately invoked in a script

I'm currently writing unit tests for a lua mod library using Busted. The file in question defines a module with some functions, then calls one of those functions at the bottom to initialize itself. The problem I'm finding is that Busted appears to…
Andy Hunt
  • 1,053
  • 1
  • 11
  • 26
0
votes
1 answer

Is there a Ruby WebMock equivalent for the Lua language?

I have a Lua module I'm writing for making requests to a public API: -- users.lua local http = require("socket.http") local base_url = 'http://example.com' local api_key = "secret" local users = {} function users.info(user_id) local…
Chip Castle
  • 2,132
  • 3
  • 20
  • 34
0
votes
1 answer

Corona TDD with busted "module 'storyboard' not found"

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…
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
0
votes
1 answer

Module unreachable using busted in Lua

I'm a beginer with Lua and I would like to use unit tests in my devs. I decided to use busted a simple and easy to use framework to do that. require "yaci" require "busted" foo = {} foor.bar = newclass( "foo.bar" ) function foo.bar:doSomething()…
MARTIN Damien
  • 996
  • 2
  • 15
  • 36
1
2