Module Pickle

Register functions for the testing framework.

Functions

stub (...) Make a test double This is for mimickin general behavior, and acts like it is a function.
carp (str) Make a carp on the current report.
cluck (str) Make a cluck on the current report.
croak (str[, level=0]) Make a croak on the current report.
confess (str[, level=0]) Make a confess(ion) on the current report.
skip (str) Make a skip comment on the current report.
todo (str) Make a todo comment on the current report.
expect (...) Expect whatever to be compared to the subject.
subject (...) Subject of whatever to be compared to the expected.
xtop (...) Silent “top” for the test.
xdescribe (...) Silent “describe” for the test.
context (...) Silent “context” for the test.
top (...) “Top” for the test.
describe (...) “Describe” for the test.
context (...) “Context” for the test.
mw.pickle.__call (opts) Install the library.
pickle.setupInterface (opts) install the module in the global space.

Fields

env.xit Silent “it” for the test.
env.it “It” for the test.
env._reports Put up a nice banner telling everyone pickle is initialized, and add the instances


Functions

stub (...)
Make a test double This is for mimickin general behavior, and acts like it is a function. Returns precomputed values or compute them on the fly.

Parameters:

  • ... table, string, boolean, number or function arguments to be parsed

Returns:

function
carp (str)
Make a carp on the current report. This is usualy called due to debugging a possible error condition. Prints a “todo” comment, caller's name and arguments.

Parameters:

  • str nil or string message to use for todo part of report

Returns:

Spy
cluck (str)
Make a cluck on the current report. This is usually called due to debugging a possible error condition. Prints a “todo” comment, caller's name and arguments, and a stack backtrace.

Parameters:

  • str nil or string message to use for todo part of report

Returns:

Spy
croak (str[, level=0])
Make a croak on the current report. This is usually called due to debugging a possible error condition. Prints a “skip” comment, caller's name and arguments, and exits.

Parameters:

  • str nil or string message to use for todo part of report
  • level nil or number to report (default 0)

Raises:

unconditionally
confess (str[, level=0])
Make a confess(ion) on the current report. This is usually called due to debugging a possible error condition. Prints a “skip” comment, caller's name and arguments, a stack backtrace, and exits.

Parameters:

  • str nil or string message to use for todo part of report
  • level nil or number to report (default 0)

Raises:

unconditionally
skip (str)
Make a skip comment on the current report. This function will not terminate the current run. Consider croak or confess.

Parameters:

  • str nil or string message to be passed on
todo (str)
Make a todo comment on the current report. This function will not terminate the current run. Consider carp or cluck.

Parameters:

  • str nil or string message to be passed on
expect (...)
Expect whatever to be compared to the subject. The expected value is the assumed outcome, or something that can be transformed into the assumed outcome.

Parameters:

  • ... varargs passed on to Adapt:create

Returns:

Adapt
subject (...)
Subject of whatever to be compared to the expected. The subject is whatever object we want to test, usually the returned table for a module.

Parameters:

  • ... varargs passed on to Adapt:create

Returns:

Adapt
xtop (...)
Silent “top” for the test. This is a level above the usual the three levels, and only used when several modules are tested simultaneously. The function will silently avoid running the fixture.

Parameters:

  • ... varargs passed on to Case:dispatch

Returns:

Case
xdescribe (...)
Silent “describe” for the test. This is the outermost of the three levels. The function will silently avoid running the fixture.

Parameters:

  • ... varargs passed on to Case:dispatch

Returns:

Case
context (...)
Silent “context” for the test. This is usually used for creating some additional context before the actual testing. The function will silently avoid running the fixture.

Parameters:

  • ... varargs passed on to Case:dispatch

Returns:

Case
top (...)
“Top” for the test. This is a level above the usual the three levels, and only used when several modules are tested simultaneously.

Parameters:

  • ... varargs passed on to Case:dispatch

Returns:

Case
describe (...)
“Describe” for the test. This is the outermost of the three levels.

Parameters:

  • ... varargs passed on to Case:dispatch

Returns:

Case
context (...)
“Context” for the test. This is usually used for creating some additional context before the actual testing. An alternate would be to use 'before' and 'after' functions.

Parameters:

  • ... varargs passed on to Case:dispatch

Returns:

Case
mw.pickle.__call (opts)
Install the library. This install all dependencies and changes the environment

Parameters:

  • opts table for the options

Returns:

self
pickle.setupInterface (opts)
install the module in the global space.

Parameters:

  • opts

Fields

env.xit
Silent “it” for the test.
  • ... vararg passed on to Case:create
env.it
“It” for the test.
  • ... vararg passed on to Case:create
env._reports
Put up a nice banner telling everyone pickle is initialized, and add the instances
generated by LDoc 1.4.6