has207/flexmock — pull request #95 by twiden (2014-05-30 11:30:43+00:00)
Title: Make it possible to assign human readable names to mock instances

I have been using flexmock for a while now and I would really like to be able to name my mocks. This a suggestion how to implement names.

Consider this failing test
```python
def test_foo(self):
def store(self, database, sql):
database.execute(database)

sql = flexmock()
database = flexmock()

database.should_receive('execute').with_args(sql).once()
store(database, sql)
```
This test will fail with the following message.
```python
MethodSignatureError: execute()
```

But with my patch we could write it like this
```python
sql = flexmock().named('sql statement')
database = flexmock().named('database')
```
Now the test will fail like this, which is much more helpful.
```python
MethodSignatureError: execute()
```

Let's say that we want to mock the Person class
```python
class Person(object):
def name(self):
return 'Alice'
```
I did not want to pass the name as a parameter to init on Mock, becuase we could run in to problems if we try to do this:
```python
flexmock(Person, name="AliceMock")
```

I think that it is much nicer to write
```python
flexmock(Person).named("AliceMock")
```

Which could give us something like:
```python
MethodSignatureError: execute()
```

What do you think? Could something like this fit into flexmock?