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
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb
sublimetheme-1.0.1 path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb
sublimetheme-1.0.0 path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb
geminfo-0.1.0 path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/rspec-expectations-3.3.0/lib/rspec/matchers/matcher_delegator.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/rspec-expectations-3.3.0/lib/rspec/matchers/matcher_delegator.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb
rspec-expectations-3.3.1 lib/rspec/matchers/matcher_delegator.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/rspec-expectations-3.3.0/lib/rspec/matchers/matcher_delegator.rb
rspec-expectations-3.3.0 lib/rspec/matchers/matcher_delegator.rb