Method: RSpec::Matchers::DSL#define
- Defined in:
- lib/rspec/matchers/dsl.rb
#define(name) {|Object| ... } ⇒ Object Also known as: matcher
Defines a custom matcher.
73 74 75 76 77 78 |
# File 'lib/rspec/matchers/dsl.rb', line 73 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 |