did anyone run into this?
Works:
MyClass.any_instance.should_receive(:my_method)
Does not work:
expect(MyClass.any_instance).to receive(:my_method)
Am I screwing up syntax here or is it just not possible to do this in expect syntax? I'd really dig sticking with expect here, but didn't work it out yet.
Thanks!
RSpec introduced expect_any_instance_of
as described in https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/working-with-legacy-code/any-instance in order to support this with "expect like" syntax. What you've shown is indeed not supported.