Class: Picard::MethodRipper
Instance Method Summary collapse
-
#initialize(ast_helper = AstHelper.new) ⇒ MethodRipper
constructor
A new instance of MethodRipper.
- #wrap_all_assertions!(method) ⇒ Object
Constructor Details
#initialize(ast_helper = AstHelper.new) ⇒ MethodRipper
Returns a new instance of MethodRipper.
3 4 5 |
# File 'lib/picard/method_ripper.rb', line 3 def initialize ast_helper = AstHelper.new @ast_helper = ast_helper end |
Instance Method Details
#wrap_all_assertions!(method) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/picard/method_ripper.rb', line 7 def wrap_all_assertions! method ast = @ast_helper.extract_ast(method) assertions = ast.all_statements_in_block(:expect) replace_all_statements_with_assertions! ast, assertions, method replace_method_implementation_in_owner! ast, method end |