Use RSpec's `allow` syntax instead of `stub`

`allow` was added to RSpec 2 along with `expect` as part of the move
away from `should` and `stub` which monkey-patched `Object`. It will be
the default in RSpec 3.