Class: Mutineer::Mutators::StatementRemoval
- Defined in:
- lib/mutineer/mutators/statement_removal.rb
Overview
Statement-removal mutator.
Replaces each non-final method statement with nil.
Instance Method Summary collapse
-
#visit_statements_node(node) ⇒ void
Visits statement nodes and emits removals.
Methods inherited from Base
Instance Method Details
#visit_statements_node(node) ⇒ void
This method returns an undefined value.
Visits statement nodes and emits removals.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mutineer/mutators/statement_removal.rb', line 15 def visit_statements_node(node) stmts = node.body return if stmts.length < 2 stmts[0...-1].each do |stmt| loc = stmt.location @mutations << Mutation.new( start_offset: loc.start_offset, end_offset: loc.end_offset, replacement: "nil", operator: :statement_removal ) end end |