struct Spectator::TestValues
- Spectator::TestValues
- Struct
- Value
- Object
Overview
Collection of test values supplied to examples. Each value is labeled by a symbol that the example knows. The values also come with a name that can be given to humans.
Included Modules
- Enumerable(Spectator::TestValues::Entry)
Defined in:
spectator/test_values.crClass Method Summary
-
.empty
Creates an empty set of sample values.
Instance Method Summary
-
#add(id : Symbol, name : String, value) : TestValues
Adds a new value by duplicating the current set and adding to it.
-
#each(&)
Iterates over all values and yields them.
-
#get_value(id : Symbol, value_type : T.class) : T forall T
Retrieves a value.
-
#get_wrapper(id : Symbol)
Retrieves the wrapper for a value.
Instance methods inherited from class Object
should(matcher)
should,
should_eventually(matcher)
should_eventually,
should_never(matcher)
should_never,
should_not(matcher)
should_not
Class Method Detail
Instance Method Detail
Adds a new value by duplicating the current set and adding to it. The new sample values with the additional value is returned. The original set of sample values is not modified.
Retrieves a value. The symbol for the value is used for retrieval. The value's type must be provided so that the wrapper can be cast.
Retrieves the wrapper for a value. The symbol for the value is used for retrieval.