Module: RSpec::Matchers::DSL

Included in:
RSpec::Matchers
Defined in:
lib/rspec/matchers/dsl.rb

Overview

Defines the custom matcher DSL.

Defined Under Namespace

Modules: DefaultImplementations, Macros Classes: Matcher

Instance Method Summary collapse

Instance Method Details

#define(name, &declarations) ⇒ Object Also known as: matcher

Defines a custom matcher.

See Also:



7
8
9
10
11
# File 'lib/rspec/matchers/dsl.rb', line 7

def define(name, &declarations)
  define_method name do |*expected|
    RSpec::Matchers::DSL::Matcher.new(name, declarations, self, *expected)
  end
end