ESpec v1.6.0 ESpec.Let View Source

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.

Link to this section Summary

Functions

Struct keeps the name of variable and random function name

Allows to define several ‘lets’ at once

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

Allows to define several ‘lets’ at once

let! evaluate block like before

Allows to define several ‘let_error’s at once

Defines ‘let’ for error result tuple

Allows to define several ‘let_error!’s at once

Defines ‘let!’ for error result tuple

Allows to define several ‘let_ok’s at once

Defines ‘let’ for success result tuple

Allows to define several ‘let_ok!’s at once

Defines ‘let!’ for success result tuple

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!’

Link to this section Functions

Struct keeps the name of variable and random function name.

Allows to define several ‘lets’ at once

Link to this macro let(var, list) View Source (macro)

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.

Allows to define several ‘lets’ at once

Link to this macro let!(var, list) View Source (macro)

let! evaluate block like before

Link to this macro let_error(keyword) View Source (macro)

Allows to define several ‘let_error’s at once

Link to this macro let_error(var, list) View Source (macro)

Defines ‘let’ for error result tuple.

Link to this macro let_error!(keyword) View Source (macro)

Allows to define several ‘let_error!’s at once

Link to this macro let_error!(var, list) View Source (macro)

Defines ‘let!’ for error result tuple.

Link to this macro let_ok(keyword) View Source (macro)

Allows to define several ‘let_ok’s at once

Link to this macro let_ok(var, list) View Source (macro)

Defines ‘let’ for success result tuple.

Link to this macro let_ok!(keyword) View Source (macro)

Allows to define several ‘let_ok!’s at once

Link to this macro let_ok!(var, list) View Source (macro)

Defines ‘let!’ for success result tuple.

Link to this macro let_overridable(keywords) View Source (macro)

Defines overridable lets in shared examples

Defines ‘subject’.

Link to this macro subject(var, list) View Source (macro)

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

Defines ‘subject!’.

Link to this macro subject!(var, list) View Source (macro)

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