lib/undercover.rb in undercover-0.1.3 vs lib/undercover.rb in undercover-0.1.4
- old
+ new
@@ -81,9 +81,10 @@
def each_result_arg
match_all = ->(_) { true }
lcov.source_files.each do |filename, coverage|
path = File.join(code_dir, filename)
root_ast = Imagen::Node::Root.new.build_from_file(path)
+ next if root_ast.children.empty?
root_ast.children[0].find_all(match_all).each do |node|
yield(path, coverage, node)
end
end
end