Sha256: cdad1737ecae7e5f2bf4268b7ad6138d76babadd5e9183bdd132ddd41e38a701

Contents?: true

Size: 852 Bytes

Versions: 5331

Compression:

Stored size: 852 Bytes

Contents

module RSpec
  module Matchers
    # Provides the necessary plumbing to wrap a matcher with a decorator.
    # @private
    class MatcherDelegator
      include Composable
      attr_reader :base_matcher

      def initialize(base_matcher)
        @base_matcher = base_matcher
      end

      def method_missing(*args, &block)
        base_matcher.__send__(*args, &block)
      end

      if ::RUBY_VERSION.to_f > 1.8
        def respond_to_missing?(name, include_all=false)
          super || base_matcher.respond_to?(name, include_all)
        end
      else
        # :nocov:
        def respond_to?(name, include_all=false)
          super || base_matcher.respond_to?(name, include_all)
        end
        # :nocov:
      end

      def initialize_copy(other)
        @base_matcher = @base_matcher.clone
        super
      end
    end
  end
end

Version data entries

5,331 entries across 5,245 versions & 119 rubygems

Version Path
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.15 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.14 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
mux_ruby-3.18.0 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.13 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.12 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.11 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
mux_ruby-3.17.0 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.10.1/lib/rspec/matchers/matcher_delegator.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.10.1/lib/rspec/matchers/matcher_delegator.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.10.1/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.10 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.9 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
mux_ruby-3.15.0 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
mux_ruby-3.14.0 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/matcher_delegator.rb
moneykit-0.1.6 vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/matchers/matcher_delegator.rb
rspec-expectations-3.12.4 lib/rspec/matchers/matcher_delegator.rb