Class Case

Baseclass for Describe, Context, and It.

This class follows the pattern from Lua classes.

Metamethods

Case:__index (key) Lookup of missing class members.
Case:__call (...) Get arguments for a instance call.

Methods

Case:create (...) Create a new instance.
Case:_init (...) Initialize a new instance.
Case:dispatch (...) Dispach on type.
Case:type () Get the type of case All frames has an explicit type name.
Case:setName (key) Set key for name of case.
Case:hasName () Check if the case has name.
Case:getName () Get the name as key for case.
Case:hasDescriptions () Check if the case has descriptions.
Case:numDescriptions () Check number of descriptions.
Case:hasFixtures () Check if the case has fixtures.
Case:numFixtures () Check number of fixtures.
Case:isDone () Check if the instance is evaluated.
Case:descriptions () Get descriptions.
Case:setSubjects (obj) Set the reference to the subjects collection.
Case:subjects () Expose reference to subjects.
Case:setReports (obj) Set the reference to the reports collection.
Case:reports () Expose reference to reports.
Case:setExtractors (obj) Set the reference to the extractors.
Case:extractors () Expose reference to extractors.
Case:setTranslators (obj) Set the reference to the translators.
Case:translators () Expose reference to translators.
Case:setRenders (obj) Set the reference to the renders.
Case:renders () Expose reference to renders.
Case:evalFixture (description, fixture, environment, ...) Eval a single fixture.
Case:eval () Eval the fixtures over previous dispatched strings.


Metamethods

Case:__index (key)
Lookup of missing class members.

Parameters:

Returns:

any

Raises:

on wrong arguments
Case:__call (...)
Get arguments for a instance call.

Parameters:

  • ... vararg pass on to dispatch

Returns:

self

Methods

Case:create (...)
Create a new instance.

Parameters:

  • ... vararg list to be dispatched

Returns:

Case
Case:_init (...)
Initialize a new instance.

Parameters:

  • ... vararg list to be dispatched (unused)

Returns:

Case
Case:dispatch (...)
Dispach on type.

Parameters:

  • ... vararg list to dispatch

Returns:

self
Case:type ()
Get the type of case All frames has an explicit type name.

Returns:

string
Case:setName (key)
Set key for name of case.

Parameters:

  • key string part of a message

Returns:

self
Case:hasName ()
Check if the case has name.

Returns:

boolean
Case:getName ()
Get the name as key for case. All frames may have an explicit name.

Returns:

string
Case:hasDescriptions ()
Check if the case has descriptions.

Returns:

boolean
Case:numDescriptions ()
Check number of descriptions.

Returns:

number
Case:hasFixtures ()
Check if the case has fixtures.

Returns:

boolean
Case:numFixtures ()
Check number of fixtures.

Returns:

number
Case:isDone ()
Check if the instance is evaluated.

Returns:

boolean
Case:descriptions ()
Get descriptions.

Returns:

list of descriptions
Case:setSubjects (obj)
Set the reference to the subjects collection. This keeps a reference, the object is not cloned.

Parameters:

  • obj table somehow maintain a collection

Returns:

self

Raises:

on wrong arguments
Case:subjects ()
Expose reference to subjects.

Returns:

list of subjects
Case:setReports (obj)
Set the reference to the reports collection. This keeps a reference, the object is not cloned.

Parameters:

  • obj table somehow maintain a collection

Returns:

self

Raises:

on wrong arguments
Case:reports ()
Expose reference to reports.

Returns:

list of reports
Case:setExtractors (obj)
Set the reference to the extractors. This keeps a reference, the object is not cloned.

Parameters:

  • obj table somehow maintain a collection

Returns:

self

Raises:

on wrong arguments
Case:extractors ()
Expose reference to extractors.

Returns:

list of extractors
Case:setTranslators (obj)
Set the reference to the translators. This keeps a reference, the object is not cloned.

Parameters:

  • obj table somehow maintain a collection

Returns:

self

Raises:

on wrong arguments
Case:translators ()
Expose reference to translators.

Returns:

list of translators
Case:setRenders (obj)
Set the reference to the renders. This keeps a reference, the object is not cloned.

Parameters:

  • obj table somehow maintain a collection

Returns:

self

Raises:

on wrong arguments
Case:renders ()
Expose reference to renders.

Returns:

list of renders
Case:evalFixture (description, fixture, environment, ...)
Eval a single fixture.

Parameters:

  • description string
  • fixture function
  • environment table
  • ...

Raises:

on wrong arguments
Case:eval ()
Eval the fixtures over previous dispatched strings.

Returns:

self
generated by LDoc 1.4.6