uber / doubles

Test doubles for Python.
MIT License
164 stars 17 forks source link

Update documentation for expects #117

Open cozos opened 8 years ago

cozos commented 8 years ago

Some pain points I had on learning the doubles API that in my opinion, the documentation could be improved with:

To clarify - reading over the docs you get the impression that the canonical pattern would be to:

# Causes nonintuitive behaviour.
allow(user).speak.then_return('blah')
expect(user).speak.exactly(2).times

Which not only doesn't work, but actually wipes out the stub you created via the first allow. Instead, the docs should show this:

# What we actually wanted.
expect(user).speak.then_return('blah').exactly(2).times