Sha256: b6d1a4ee8ffb852248e920c55d63963df12825f260b1b5c9791c085a5ac46a80

Contents?: true

Size: 718 Bytes

Versions: 29

Compression:

Stored size: 718 Bytes

Contents

module Shoulda
  module Matchers
    module Doublespeak
      # @private
      class ProxyImplementation
        extend Forwardable

        DoubleImplementationRegistry.register(self, :proxy)

        def_delegators :stub_implementation, :returns

        def self.create
          new(StubImplementation.new)
        end

        def initialize(stub_implementation)
          @stub_implementation = stub_implementation
        end

        def call(call)
          return_value = call.double.call_original_method(call)
          stub_implementation.call(call.with_return_value(return_value))
          return_value
        end

        protected

        attr_reader :stub_implementation
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
shoulda-matchers-6.4.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-6.3.1 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-6.3.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-6.2.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-6.1.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-6.0.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-5.3.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-5.2.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-5.1.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-5.0.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-5.0.0.rc1 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.5.1 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.5.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.4.1 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.4.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.3.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.2.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.1.2 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.1.1 lib/shoulda/matchers/doublespeak/proxy_implementation.rb
shoulda-matchers-4.1.0 lib/shoulda/matchers/doublespeak/proxy_implementation.rb