_spec.lua
. For example, simple_spec.lua
:simple_spec.lua
to use of the Run.This instance available to every test:hs.timer
to actually make this asynchronous, the key additions here are:this:wait(5)
: Tells the test that it is asynchronous, and to wait 5 seconds before timing out.this:done()
: Called inside the asynchronous function to indicate that it's complete.assert
, an error
or a call to this:fail(...) or this:abort(...)​".*"
to the end.cp.spec.describe(name) -> function(definitions) -> cp.spec.Specification
cp.spec.find(idPattern) -> cp.spec.Definition
cp.spec.Handled.is(other) -> boolean
other
is an instance of the Handled
class.cp.spec.it(name[, ...]) -> cp.spec.Scenario
function
to call when doing the operation. Will be passed the Run.This instance for the definition.cp.spec.setSearchPath(path)
spec
files with the spec "my.extension"
call.spec
files. Set to nil
to only search the default package path.cp.spec(id) -> cp.spec.Definition
cp.spec.test(id) -> cp.spec.Definition
cp.test
ID (eg. "cp.app"
).Definition
or throws an error if it can't be found.