Sha256: d872c8fce3356cbf092571a67bf7afd5bf23312bd438d48a4b70b7e7e41998e6

Contents?: true

Size: 565 Bytes

Versions: 59

Compression:

Stored size: 565 Bytes

Contents

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

59 entries across 59 versions & 5 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.8 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.7 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.6 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.5 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.4 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.3 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.6.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.5.17 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.5.16 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb