Class: RSpock::AST::TestMethodTransformation

Inherits:
ASTTransform::AbstractTransformation
  • Object
show all
Defined in:
lib/rspock/ast/test_method_transformation.rb

Instance Method Summary collapse

Constructor Details

#initialize(block_registry, strict: true) ⇒ TestMethodTransformation

Returns a new instance of TestMethodTransformation.



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

def initialize(block_registry, strict: true)
  @parser = Parser::TestMethodParser.new(block_registry, strict: strict)
  @statement_transformation = StatementToAssertionTransformation.new
end

Instance Method Details

#run(node) ⇒ Object



20
21
22
23
24
# File 'lib/rspock/ast/test_method_transformation.rb', line 20

def run(node)
  rspock_ast = @parser.parse(node)
  return node if rspock_ast.nil?
  transform(rspock_ast)
end