module Spectator::DSL::Memoize
Overview
DSL methods for defining test values (subjects). These values are stored and reused throughout the test.
Direct including types
Defined in:
spectator/dsl/memoize.crMacro Summary
-
let(name, &block)
Defines a memoized getter.
-
let!(name, &block)
Defines a memoized getter.
-
subject(&block)
Explicitly defines the subject of the tests.
-
subject(name, &block)
Explicitly defines the subject of the tests.
-
subject!(&block)
Explicitly defines the subject of the tests.
-
subject!(name, &block)
Explicitly defines the subject of the tests.
Macro Detail
Defines a memoized getter. The name is the name of the getter method. The block is evaluated only on the first time the getter is used and the return value is saved for subsequent calls.
Defines a memoized getter. The name is the name of the getter method. The block is evaluated once before the example runs and the return value is saved.
Explicitly defines the subject of the tests. Creates a memoized getter for the subject. The block is evaluated only the first time the subject is referenced and the return value is saved for subsequent calls.
Explicitly defines the subject of the tests.
Creates a memoized getter for the subject.
The subject can be referenced by using subject
or name.
The block is evaluated only the first time the subject is referenced
and the return value is saved for subsequent calls.
Explicitly defines the subject of the tests. Creates a memoized getter for the subject. The block is evaluated once before the example runs and the return value is saved for subsequent calls.