class RSpec::Matchers::DSL::Matcher

def extend(*modules)

def extend(*modules)
  return_value = super
  modules.each do |mod|
    mod.instance_methods.each do |name|
      add_deprecation_warning_to(name,
        "Calling a helper method (`#{name}`) from a module extended onto a custom matcher",
        "`include #{mod.name || "TheModule"}`",
        "extended onto the custom matcher",
        :if
      )
    end
  end unless @define_block_executed
  return_value
end