module RBS::UnitTest::Spy
Public Class Methods
[T] (untyped object, Symbol method_name) → WrapSpy[T]
[T, S] (untyped object, Symbol method_name) { (WrapSpy[T], T) → S } → S
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/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