module RSpec::Matchers::DSL

Public Instance Methods

define(name, &declarations) click to toggle source

Defines a custom matcher. @see RSpec::Matchers

# File lib/rspec/matchers/dsl.rb, line 6
def define(name, &declarations)
  matcher_template = RSpec::Matchers::DSL::Matcher.new(name, &declarations)
  define_method name do |*expected|
    matcher = matcher_template.for_expected(*expected)
    matcher.matcher_execution_context = @matcher_execution_context ||= self
    matcher
  end
end
Also aliased as: matcher
matcher(name, &declarations) click to toggle source
Alias for: define