module

Spectator::DSL::Memoize

DSL methods for defining test values (subjects). These values are stored and reused throughout the test.

Macros

let(name, &block)

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.

Source
let!(name, &block)

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.

Source
subject

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.

Source
subject(name, &block)

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.

Source
subject!

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.

Source
subject!(name, &block)

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 once before the example runs and the return value is saved for subsequent calls.

Source