Class: RSpock::AST::ExpectBlock

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

Instance Attribute Summary

Attributes inherited from Block

#node, #type

Instance Method Summary collapse

Methods inherited from Block

#<<, #node_container=, #node_container?, #range, #succession_error_msg, #unshift, #valid_successor?

Constructor Details

#initialize(node) ⇒ ExpectBlock

Returns a new instance of ExpectBlock.



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

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

Instance Method Details

#childrenObject



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

def children
  super.map { |child| ComparisonToAssertionTransformation.new(:_test_index_, :_line_number_).run(child) }
end

#successorsObject



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

def successors
  @successors ||= [:Cleanup, :Where, :End].freeze
end