Class gabarito.Gabarito
Class defined in:lib/gabarito.js:1449
Index
Methods
add( test )
lib/gabarito.js:1801
Adds a test within the gabarito.
The test is an object containing various methods. Each method is treated as a test clause. Every draft is run to check if it works.
Parameters:-
test<Object>The test itself
matcher( fn )
lib/gabarito.js:1942
Creates a custom matcher using the function as a matching criteria.
The function will receive a value to examinate and should return a boolean indicating whether the criteria is met.
Parameters:-
fn<Function>The matcher function
matcher.args( fn, [msg] )
lib/gabarito.js:1009
Matcher for varargs
Parameters:-
fn<Function> -
[msg]<String>The optional message format
matcher.argsGrabber( )
lib/gabarito.js:1083
Just like the grabber matcher, this matcher that always passes. It stores the values passed to the matcher for further inspection later on.
It works as a varargs matcher.
matcher.grabber( )
lib/gabarito.js:1056
Returns a matcher that always passes. This matcher stores the value passed to the matcher for further inspection later on.
matcher.type( type, [msg] )
lib/gabarito.js:982
Matcher for a given type
Parameters:-
type<Function> -
[msg]<String>The optional message format
gabarito.Matcher
matcher.value( v, [msg] )
lib/gabarito.js:1023
Literal value matcher
If given value is an object (not a function) or an array, it uses parts.equals, otherwise it will check for it's identity
Parameters:-
v<Mixed> -
[msg]<String>
message( args )
lib/gabarito.js:1907
Tells gabarito to send a message. Messages wont be shown on the console output, they are useful for sending specific messages to the reporters.
Parameters:-
args<Mixed> (*..n)
on( event, listener )
lib/gabarito.js:1817
Register an event listener for a given event.
Available events:
- init: The initialization of the gabarito verification.
- begin: The beginning of a test verification.
- enter: When gabarito is about to enter into a clause verification.
- pass: Whenever a clause passes.
- fail: Whenever a clause fails.
- end: When a test verification has ended.
- complete: When all the test verifications have completed.
- say: Custom event to emit whatever message.
-
event<String> -
listener<Function>
reset( )
lib/gabarito.js:1766
Resets the gabarito to it's initial state, removing all listeners as well.
spy( fn )
lib/gabarito.js:1930
Creates an instance of gabarito.Spy
Parameters:-
fn<Function>Function to spy on
The spy handler function
test( [name] )
lib/gabarito.js:1744
Adds a test using the gabarito.TestBuilder within gabarito.
Parameters:-
[name]<String>The test's name