class RSpec::Matchers::DSL::Matcher
def singleton_method_added(name)
def singleton_method_added(name) return unless @block_method_differentiator if @block_method_differentiator.instance_methods.include?(name) add_deprecation_warning_to(name, "Calling a helper method (`#{name}`) defined as an instance method (using `def #{name}`) as a macro from a custom matcher `define` block", "`def self.#{name}` (to define it as a singleton method)", "defined in the custom matcher definition block", :unless ) elsif @block_method_differentiator.singleton_methods.include?(name) add_deprecation_warning_to(name, "Calling a helper method (`#{name}`) defined as a singleton method (using `def self.#{name}`) on a custom matcher", "`def #{name}` (to define it as an instance method)", "defined in the custom matcher definition block", :if ) end end