I think your wording is a bit misleading: allow doesn't assume that an object responds to a message, it is explicitly required. The "assume" part is about the method getting called. It might or might not get called, but when it does, you want it to return "The RSpec book"
It's the same with expect: You don't expect what the call returns, you expect the call itself - meaning that you want your test to fail if the call doesn't happen in your subject under test. And when it actually gets called, you want it to return precisely "The RSpec Book".
I think your wording is a bit misleading:
allow
doesn't assume that an object responds to a message, it is explicitly required. The "assume" part is about the method getting called. It might or might not get called, but when it does, you want it to return"The RSpec book"
It's the same with
expect
: You don't expect what the call returns, you expect the call itself - meaning that you want your test to fail if the call doesn't happen in your subject under test. And when it actually gets called, you want it to return precisely"The RSpec Book"
.It's a subtle but important distinction.