Sha256: 28c212f7b58a60cdc85fa8dac4d33a0e36252dc8968df59ba1ecd72ef37c49d0

Contents?: true

Size: 520 Bytes

Versions: 12

Compression:

Stored size: 520 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_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

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb
rspec-expectations-2.8.0.rc1 lib/rspec/matchers/dsl.rb
rspec-expectations-2.7.0 lib/rspec/matchers/dsl.rb
rspec-expectations-2.7.0.rc1 lib/rspec/matchers/dsl.rb