Spies

All of carp, cluck, croak, and confess are “spies”, a concept borrowed from Perl where it is used to mark lines in code. The functions make a report when they are reached. They can be viewed as very minimal single statement debug actions.

A spy can be added to the code under inspection, and will then do its action when execution reaches the call, or it can be injected in place of some other library code. The later is possible if there exist some reference to the library.

Spies straight out of Spy will not integrate with the reporting system, it must be told where to send the reports.

Usage

All types of spies use the same basic principle, and is Spy instances. A number of arguments are collected, and when the spy is called the code is executed accordingly.

Carp function

The carp function is a convenience function for creating a spy that warns when executed, and provides the arguments. Calling carp will comment the running test as a todo.

Cluck function

The cluck function is a convenience function for creating a spy that warns when executed, and provides the arguments and a backtrace. Calling cluck will comment the running test as a todo.

Croak function

The croak function is a convenience function for creating a spy that dies when executed, and provides the arguments. Calling croak will comment the running test as a skip.

Confess function

The confess function is a convenience function for creating a spy that dies when executed, and provides the arguments and a backtrace. Calling confess will comment the running test as a skip.

generated by LDoc 1.4.6