class RSpec::Mocks::DirectObjectReference

def const_to_replace

is invalid when passing an object argument to `object_double`.
implementations. Raises an `ArgumentError` to indicate that `as_stubbed_const`
Defined for interface parity with the other object reference
def const_to_replace
  raise ArgumentError,
        "Can not perform constant replacement with an anonymous object."
end