API Docs for: 0.1.0

Class gabarito.TestBuilder

Class defined in: lib/gabarito.js:722

The test builder is a helper that builds a test in a more expressive way.

Usage:

gabarito.test().
name("test name").
before(function () {
    // runs before each clause
}).
after(function () {
    // runs after each clause
}).

clause("an unimplemented clause").
clause("another clause", function () {
   // clause body
});
gabarito.TestBuilder( test )
lib/gabarito.js:722
Parameters:
  • test <Object>

    The actual test object

Index

Methods

gabarito.TestBuilder after( after )
lib/gabarito.js:786

Sets the after function within the test object.

Parameters:
  • after <Function>

gabarito.TestBuilder before( before )
lib/gabarito.js:772

Sets the before function within the test object.

Parameters:
  • before <Function>

gabarito.TestBuilder clause( name, [body] )
lib/gabarito.js:754

Adds a clause within the test object.

If the clause body is omitted, an unimplemented clause that always throws an error will be used instead.

Parameters:
  • name <String>
  • [body] <Function>

gabarito.TestBuilder name( name )
lib/gabarito.js:800

Sets test name for the test object.

Parameters:
  • name <String>