Module: Spec::Matchers::DSL

Included in:
Spec::Matchers
Defined in:
lib/spec/matchers/dsl.rb

Instance Method Summary collapse

Instance Method Details

#create(name, &declarations) ⇒ Object

Deprecated - use define



12
13
14
15
# File 'lib/spec/matchers/dsl.rb', line 12

def create(name, &declarations)
  Spec.deprecate("Spec::Matchers.create","Spec::Matchers.define")
  define(name, &declarations)
end

#define(name, &declarations) ⇒ Object

See Spec::Matchers



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

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