Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 70dd1757f5
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (21 sloc) 0.648 kB
module RSpec
module Matchers
module DSL
# Defines a custom matcher.
# @see RSpec::Matchers
def define(name, &declarations)
matcher_template = RSpec::Matchers::DSL::Matcher.new(name, &declarations)
define_method name do |*expected|
matcher = matcher_template.for_expected(*expected)
matcher.matcher_execution_context = @matcher_execution_context || self
matcher
end
end
alias_method :matcher, :define
if RSpec.respond_to?(:configure)
RSpec.configure {|c| c.extend self}
end
end
end
end
RSpec::Matchers.extend RSpec::Matchers::DSL
Jump to Line
Something went wrong with that request. Please try again.