Class: RSpock::AST::TestMethodTransformation
- Inherits:
-
ASTTransform::AbstractTransformation
- Object
- ASTTransform::AbstractTransformation
- RSpock::AST::TestMethodTransformation
- Defined in:
- lib/rspock/ast/test_method_transformation.rb
Instance Method Summary collapse
-
#initialize(block_registry, strict: true) ⇒ TestMethodTransformation
constructor
A new instance of TestMethodTransformation.
- #run(node) ⇒ Object
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 |