Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 520 Bytes
module RSpec
module Matchers
module DSL
# Defines a custom matcher.
# @see RSpec::Matchers
def define(name, &declarations)
define_method name do |*expected|
$matcher_execution_context = self
RSpec::Matchers::Matcher.new name, *expected, &declarations
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
Something went wrong with that request. Please try again.