Sha256: b444f948594f8393edd652f85010c2e20638c9d650b35d916a751826798b9ea3

Contents?: true

Size: 591 Bytes

Versions: 7

Compression:

Stored size: 591 Bytes

Contents

module RSpec
  module Matchers
    module DSL
      # Defines a custom matcher.
      # @see RSpec::Matchers
      def define(name, &declarations)
        define_method name do |*expected|
          matcher = RSpec::Matchers::DSL::Matcher.new(name, declarations, *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

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
opal-rspec-cj-0.4.4 vendor_lib/rspec/matchers/dsl.rb
opal-rspec-0.4.3 vendor_lib/rspec/matchers/dsl.rb
opal-rspec-0.4.2 vendor_lib/rspec/matchers/dsl.rb
opal-rspec-0.4.1 vendor_lib/rspec/matchers/dsl.rb
opal-rspec-0.4.0 vendor_lib/rspec/matchers/dsl.rb
opal-rspec-0.4.0.beta4 vendor_lib/rspec/matchers/dsl.rb
rspec-expectations-3.0.0.beta1 lib/rspec/matchers/dsl.rb