Class: RSpock::AST::TestMethodTransformation

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

Defined Under Namespace

Classes: Section

Instance Method Summary collapse

Constructor Details

#initialize(block_registry, strict: true) ⇒ TestMethodTransformation

Returns a new instance of TestMethodTransformation.



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

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



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

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