Skip to content

Memoized helper #10

@Uncommon

Description

@Uncommon

Look into creating an equivalent of let.

RSpec's let defines a memoized helper method, which is lazy-evaluated but returns the same value for each example in the group. That means all descendants of a particular subgroup get the same value, and different subgroups each get different values for their descendants.

let! is evaluated immediately, and is described as for values that need to be available for hooks.

This is different from using plain local variables, which would be instantiated when the spec is evaluated (unless they're lazy) and the same value is provided to everything in the scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Maybe

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions