lib/covered/source.rb in covered-0.16.2 vs lib/covered/source.rb in covered-0.16.3
- old
+ new
@@ -69,22 +69,32 @@
attr :paths
EXECUTABLE = {
send: true,
yield: true,
- return: true,
+ # Line trace point is not triggered for return statements.
+ # return: true,
def: true,
if: true,
- lvasgn: true, ivasgn: true, cvasgn: true, gvasgn: true,
+ lvasgn: true,
+ ivasgn: true,
+ cvasgn: true,
+ gvasgn: true,
match_pattern: true
}
def executable?(node)
EXECUTABLE[node.type]
end
+ IGNORE = {
+ arg: true,
+ # Ruby doesn't appear to execute rescue lines.
+ rescue: true
+ }
+
def ignore?(node)
- node.nil? or node.type == :arg
+ node.nil? || IGNORE[node.type]
end
def expand(node, coverage, level = 0)
if node.is_a? Parser::AST::Node
if ignore?(node)