garybernhardt/dingus — pull request #19 by poiati (2012-08-29 04:26:42+00:00)
Title: The assert_call method

Hello Gary,

What do you think about this?

```python
from dingus import Dingus, assert_call

ding = Dingus('ding')

assert_call(ding, 'foo')
```

Guives:

```text
Traceback (most recent call last):
File "", line 1, in
File "/Users/paulogpoiati2/virtualenv/dingus_test/lib/python2.7/site-packages/dingus.py", line 393, in assert_call
raise AssertionError(message)
AssertionError: Expected a call to method: 'foo', args: (), kwargs: {}, dingus:
No calls recorded
```text

----------------------

Another example:

```python
from dingus import Dingus, assert_call

ding = Dingus('ding')
ding.bar('hello', 'world', one=1, two=2)

assert_call(ding, 'foo')
```

Guives:

```text
Traceback (most recent call last):
File "", line 1, in
File "/Users/paulogpoiati2/virtualenv/dingus_test/lib/python2.7/site-packages/dingus.py", line 393, in assert_call
raise AssertionError(message)
AssertionError: Expected a call to method: 'foo', args: (), kwargs: {}, dingus:
Recorded calls: [('bar', ('hello', 'world'), {'two': 2, 'one': 1}, )]
```

Cheers,
Poiati.