Sha256: ab987a20cfa7c80026430ee480419ae38066fc5e7a4b1f9ee64db28f746f6bf3

Contents?: true

Size: 847 Bytes

Versions: 29

Compression:

Stored size: 847 Bytes

Contents

module RSpec
  module Support
    # @private
    def self.matcher_definitions
      @matcher_definitions ||= []
    end

    # Used internally to break cyclic dependency between mocks, expectations,
    # and support. We don't currently have a consistent implementation of our
    # matchers, though we are considering changing that:
    # https://github.com/rspec/rspec-mocks/issues/513
    #
    # @private
    def self.register_matcher_definition(&block)
      matcher_definitions << block
    end

    # Remove a previously registered matcher. Useful for cleaning up after
    # yourself in specs.
    #
    # @private
    def self.deregister_matcher_definition(&block)
      matcher_definitions.delete(block)
    end

    # @private
    def self.is_a_matcher?(object)
      matcher_definitions.any? { |md| md.call(object) }
    end
  end
end

Version data entries

29 entries across 26 versions & 8 rubygems

Version Path
opal-rspec-0.8.0 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.8.0.alpha3 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.8.0.alpha2 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.8.0.alpha1 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.7.1 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.7.0 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.6.2 rspec-support/lib/rspec/support/matcher_definition.rb
opal-rspec-0.7.0.rc.2 rspec-support/upstream/lib/rspec/support/matcher_definition.rb
opal-rspec-0.6.1 rspec-support/lib/rspec/support/matcher_definition.rb
opal-rspec-0.6.0 rspec-support/lib/rspec/support/matcher_definition.rb
opal-rspec-0.6.0.beta1 rspec-support/lib/rspec/support/matcher_definition.rb
opal-connect-rspec-0.5.0 rspec-support/lib/rspec/support/matcher_definition.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/rspec-support-3.1.2/lib/rspec/support/matcher_definition.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/rspec-support-3.1.0/lib/rspec/support/matcher_definition.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/rspec-support-3.1.0/lib/rspec/support/matcher_definition.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/rspec-support-3.1.0/lib/rspec/support/matcher_definition.rb
opal-rspec-0.5.0 rspec-support/lib/rspec/support/matcher_definition.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/rspec-support-3.1.2/lib/rspec/support/matcher_definition.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/rspec-support-3.1.2/lib/rspec/support/matcher_definition.rb
logstash-codec-json-2.0.3 vendor/gems/rspec-support-3.1.2/lib/rspec/support/matcher_definition.rb