Class: RSpock::AST::StartBlock
- Defined in:
- lib/rspock/ast/start_block.rb
Constant Summary collapse
- SUCCESSORS_WITHOUT_CHILDREN =
[:Given, :When, :Expect].freeze
- SUCCESSORS_WITH_CHILDREN =
[:End].freeze
Instance Attribute Summary
Attributes inherited from Block
Instance Method Summary collapse
-
#initialize(node) ⇒ StartBlock
constructor
A new instance of StartBlock.
- #succession_error_msg ⇒ Object
- #successors ⇒ Object
Methods inherited from Block
#<<, #children, #node_container=, #node_container?, #range, #unshift, #valid_successor?
Constructor Details
#initialize(node) ⇒ StartBlock
Returns a new instance of StartBlock.
7 8 9 10 |
# File 'lib/rspock/ast/start_block.rb', line 7 def initialize(node) super(:Start, node) @node_container = false end |
Instance Method Details
#succession_error_msg ⇒ Object
20 21 22 |
# File 'lib/rspock/ast/start_block.rb', line 20 def succession_error_msg "Test method @ #{range} must start with one of these Blocks: #{successors}" end |
#successors ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/rspock/ast/start_block.rb', line 12 def successors if @children.empty? SUCCESSORS_WITHOUT_CHILDREN else SUCCESSORS_WITH_CHILDREN end end |