should.lua: bringing BDD-style assertions to Lua
After having released three smaller libraries for Lua I embarked on a pretty
ambitious journey: to create a BDD-style assertion library, which I then named
should.lua.
Busted has been my testing framework of choice
and I’m a big fan of it, but I don’t really like using assert
when I use
describe
and it
in my tests. Now I can write my tests like this:
expect
is also available:
expect
is actually just a thin “wrapper” for the should
library, which
I hacked together using the recommended way for creating
classes in Lua. It was a challenge, but
a pretty fun one. However, it’s far from finished so pull requests are always
welcome!