ClockInterface
is an interface rather than a class, and doesn’t have the __persistent__
method, unlike classes for which that method gets added through their proxy.
To get your test to work properly, you should instead use:
clock = mock(ClockInterface)
clock.should_receive(:currentTime)