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
- class_name (String) — the qualified name of the class.
- base_class (Class, String) — the base class or name of the base
class. This can be the name of another example class, as long as the
base class is defined earlier in the example group or in a parent
example group.
Yields
- definitions for the temporary class. This block is evaluated in
the context of the example, meaning that methods or memoized helpers
can be referenced.
Yield Parameters
- klass (Class) — the temporary class.
#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