提交 841f915f 编写于 作者: J Justin Collins

Fix remove_method in RescanTestHelper

上级 524f8a9b
......@@ -219,18 +219,14 @@ module BrakemanTester::RescanTestHelper
replace_with_sexp file do |parsed|
class_body = parsed.body
if class_body[1].node_type == :block
class_body[1].reject! do |node|
node.is_a? Sexp and
node.node_type == :defn and
node.method_name == method_name
end
elsif class_body[1].node_type == :defn and
class_body[1].method_name == method_name
class_body.delete_at 1
class_body.reject! do |node|
node.is_a? Sexp and
node.node_type == :defn and
node.method_name == method_name
end
parsed.body = class_body
parsed
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册