module Mocha::ParameterMatchers

Matcher classes used as parameters for {Expectation#with} to restrict the parameter values which will match the expectation. Can be nested. Build matcher instances in tests using methods in {Methods}, e.g. {Methods#includes}.

Public Class Methods

access_deprecated?(name) click to toggle source

@private

# File lib/mocha/parameter_matchers/deprecations.rb, line 30
def self.access_deprecated?(name)
  @classes_with_access_deprecated.include?(name)
end
define_deprecated_matcher_method(name) click to toggle source

@private

# File lib/mocha/parameter_matchers/deprecations.rb, line 35
def self.define_deprecated_matcher_method(name)
  define_method(name) do |*args|
    Deprecation.warning(
      "Calling #{ParameterMatchers}##{name} is deprecated. Use #{Methods}##{name} instead."
    )
    Methods.instance_method(name).bind(self).call(*args)
  end
end
provide_deprecated_access_to(name) click to toggle source

@private

# File lib/mocha/parameter_matchers/deprecations.rb, line 25
def self.provide_deprecated_access_to(name)
  @classes_with_access_deprecated.add(name)
end