There's an opportunity for misunderstanding how allow and expect work. In particular, when using expect with and_return, you'll get the following exception:
UnsupportedMethodError: `expect` does not support and_return. Use `allow` and assert that an exception is raised instead.
Yet, if you replace directly with allow, you'll get the same behavior (except that the fact that it's called is not asserted, only that if it is called it's called how it's allowed to be called). So the part about Use allow and assert that an exception is raised instead. is confusing.
There's an opportunity for misunderstanding how
allow
andexpect
work. In particular, when usingexpect
withand_return
, you'll get the following exception:Yet, if you replace directly with
allow
, you'll get the same behavior (except that the fact that it's called is not asserted, only that if it is called it's called how it's allowed to be called). So the part aboutUse allow and assert that an exception is raised instead.
is confusing.Thoughts?