ESpec v0.8.26 ESpec.Let

Defines ‘let’, ‘let!’ and ‘subject’ macros. ‘let’ and ‘let!’ macros define named functions with cached return values. The ‘let’ evaluate block in runtime when called first time. The ‘let!’ evaluates as a before block just after all ‘befores’ for example. The ‘subject’ macro is just an alias for let to define subject.

Summary

Functions

Struct keeps the name of variable and random function name

Macros

The macro defines function with random name which returns block value. That function will be called when example is run. The function will place the block value to the Agent dict

let! evaluate block like before

Defines overridable lets in shared examples

Defines ‘subject’

Defines ‘subject’ with name. It is just an alias for ‘let’

Defines ‘subject!’

Defines ‘subject!’ with name. It is just an alias for ‘let!’

Functions

__struct__()

Struct keeps the name of variable and random function name.

Macros

let(var, list)

The macro defines function with random name which returns block value. That function will be called when example is run. The function will place the block value to the Agent dict.

let!(var, list)

let! evaluate block like before

let_overridable(keywords)

Defines overridable lets in shared examples

subject(var)

Defines ‘subject’.

subject(var, list)

Defines ‘subject’ with name. It is just an alias for ‘let’.

subject!(var)

Defines ‘subject!’.

subject!(var, list)

Defines ‘subject!’ with name. It is just an alias for ‘let!’.