module RSpec::Mocks::ArgumentMatchers

def instance_of(klass)

expect(object).to receive(:message).with(instance_of(Thing))
@example

Matches if `arg.instance_of?(klass)`
def instance_of(klass)
  InstanceOf.new(klass)
end