Module: RBS::UnitTest::Spy

Defined in:
lib/rbs/unit_test/spy.rb

Defined Under Namespace

Classes: WrapSpy

Class Method Summary collapse

Class Method Details

.wrap(object, method_name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File '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