File: spy_verification_proxy.rb

package info (click to toggle)
ruby-rr 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,424 kB
  • sloc: ruby: 11,405; makefile: 7
file content (20 lines) | stat: -rw-r--r-- 534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module RR
  class SpyVerificationProxy
    BlankSlate.call(self)

    def initialize(subject)
      @subject = subject
    end

    if KeywordArguments.fully_supported?
      def method_missing(method_name, *args, **kwargs, &block)
        SpyVerification.new(@subject, method_name, args, kwargs)
      end
    else
      def method_missing(method_name, *args, &block)
        SpyVerification.new(@subject, method_name, args, {})
      end
      ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
    end
  end
end