abstract class Spectator::Node
- Spectator::Node
- Reference
- Object
Overview
A single item in a test spec.
This is commonly an Example
or ExampleGroup
,
but can be anything that should be iterated over when running the spec.
Direct Known Subclasses
Defined in:
spectator/node.crConstant Summary
-
DEFAULT_PENDING_REASON =
"No reason given"
-
Default text used if none was given by the user for skipping a node.
Constructors
-
.new(name : Label = nil, location : Location | Nil = nil, metadata : Metadata | Nil = nil)
Creates the node.
Instance Method Summary
-
#display_name
Non-nil name used to show the node name.
-
#finished? : Bool
Indicates whether the node has completed.
-
#inspect(io : IO) : Nil
Exposes information about the node useful for debugging.
-
#location : Location
Location of the node in source code.
-
#location? : Location | Nil
Location of the node in source code.
-
#metadata : Metadata
User-defined tags and values used for filtering and behavior modification.
-
#name : Label
User-provided name or description of the node.
-
#name? : Label | Nil
User-provided name or description of the node.
-
#pending?
Checks if the node has been marked as pending.
-
#pending_reason
Gets the reason the node has been marked as pending.
-
#tags
Retrieves just the tag names applied to the node.
-
#to_s(io : IO) : Nil
Constructs the full name or description of the node.
Instance methods inherited from class Object
should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall Ushould(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_not
Constructor Detail
Creates the node.
The name describes the purpose of the node.
It can be a Symbol
to describe a type.
The location tracks where the node exists in source code.
A set of metadata can be used for filtering and modifying example behavior.
Instance Method Detail
User-defined tags and values used for filtering and behavior modification.
User-provided name or description of the node.
This does not include the group name or descriptions.
Use #to_s
to get the full name.
This value will be nil if no name was provided. In this case, and the node is a runnable example, the name should be set to the description of the first matcher that runs in the test case.
If this value is a Symbol
, the user specified a type for the name.
User-provided name or description of the node.
This does not include the group name or descriptions.
Use #to_s
to get the full name.
This value will be nil if no name was provided. In this case, and the node is a runnable example, the name should be set to the description of the first matcher that runs in the test case.
If this value is a Symbol
, the user specified a type for the name.
Checks if the node has been marked as pending. Pending items should be skipped during execution.
Constructs the full name or description of the node. This prepends names of groups this node is part of.