module RBS::UnitTest::Spy - rbs: Ruby Standard Library Documentation

# module RBS::UnitTest::Spy

### Public Class Methods

wrap(object, method_name) { |spy, wrapped_object| ... } click to toggle source

    # File rbs-3.8.0/lib/rbs/unit_test/spy.rb, line 6
    def self.wrap(object, method_name)
      spy = WrapSpy.new(object: object, method_name: method_name)

      if block_given?
        begin
          yield spy, spy.wrapped_object
        end
      else
        spy
      end
    end