Module: RSpec::Matchers::DSL

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

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

Defines a custom matcher.

See Also:

7
8
9
10
11
12
# File 'lib/rspec/matchers/dsl.rb', line 7
def define(name, &declarations)
  warn_about_block_args(name, declarations)
  define_method name do |*expected, &block_arg|
    RSpec::Matchers::DSL::Matcher.new(name, declarations, self, *expected, &block_arg)
  end
end