class RuboCop::Cop::RSpec::SubjectStub
def find_subject_expectations(node, subject_names = [], &block)
def find_subject_expectations(node, subject_names = [], &block) subject_names = [*subject_names, *@explicit_subjects[node]] subject_names -= @subject_overrides[node] if @subject_overrides[node] names = Set[*subject_names, :subject] expectation_detected = message_expectation?(node, names) return yield(node) if expectation_detected node.each_child_node(:send, :def, :block, :begin) do |child| find_subject_expectations(child, subject_names, &block) end end