Class: RSpock::AST::Parser::GivenBlock

Inherits:
Block
  • Object
show all
Defined in:
lib/rspock/ast/parser/given_block.rb

Instance Attribute Summary

Attributes inherited from Block

#node, #type

Instance Method Summary collapse

Methods inherited from Block

#<<, #can_end?, #children, #range, #succession_error_msg, #to_rspock_node, #valid_successor?

Constructor Details

#initialize(node) ⇒ GivenBlock

Returns a new instance of GivenBlock.



8
9
10
# File 'lib/rspock/ast/parser/given_block.rb', line 8

def initialize(node)
  super(:Given, node)
end

Instance Method Details

#can_start?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rspock/ast/parser/given_block.rb', line 12

def can_start?
  true
end

#successorsObject



16
17
18
# File 'lib/rspock/ast/parser/given_block.rb', line 16

def successors
  @successors ||= [:When, :Expect].freeze
end