RSpec

Library providing tools for writing and running RSpec tests.

Module: RSpec::SleepingKingStudios::Deferred::Dsl::ExampleConstants

Parent Namespace
RSpec::SleepingKingStudios::Deferred::Dsl
Defined In
lib/rspec/sleeping_king_studios/deferred/dsl/example_constants.rb

Table Of Contents

Overview

Domain-specific language for defining deferred example constants.

See Also

Back To Top

Instance Methods

#example_class(class_name, base_class = nil, &) => Object

Defines a deferred temporary class scoped to the current example.

Parameters

Yields

Yield Parameters

#example_constant(constant_name, constant_value) => Object (deprecated)
#example_constant(constant_name, &block) => Object (deprecated)

Deprecated. 2.8.0 with force: true parameter.

Overloads

#example_constant(constant_name, constant_value) => Object

Defines a deferred temporary constant scoped to the current example.

Parameters
  • constant_name (String) — the qualified name of the constant.
  • constant_value (Object) — the value of the constant.
#example_constant(constant_name, &block) => Object

Defines a deferred temporary constant scoped to the current example.

Parameters
  • constant_name (String) — the qualified name of the constant.
Yields
  • generates the constant value. This block is evaluated in the context of the example, meaning that methods or memoized helpers can be referenced.
Yield Returns
  • the value of the constant.

Back To Top


Back to Documentation | Versions | 2.8 | Reference | RSpec | RSpec::SleepingKingStudios | RSpec::SleepingKingStudios::Deferred | RSpec::SleepingKingStudios::Deferred::Dsl