Module: RSpec::Matchers::DSL

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

Instance Method Summary collapse

Instance Method Details

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

See RSpec::Matchers



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

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