Olivine-Labs/luassert — pull request #72 by o-lim (2014-12-30 05:54:07+00:00)
Title: Fix error message for has_error()

When ```has_error()``` fails, the error message is misleading, implying that an error was thrown, but did not match what was expected, yet ```Caught``` and ```Expected``` both match each other.

The following failure:
```lua
assert.has_error(function() end)
```
produces the following error message:
```
say/init.lua:46: bad argument #2 to 'format' (no value)

stack traceback:
say/init.lua:46: in function 's'
luassert/assert.lua:60: in function 'error'
```
Fix ```has_error()``` to show the proper error message of the form:
```
Expected a different error.
Caught:
...
Expected:
...
```
and update the error message to more accurately describe the error when no error message is passed in, showing:
```
Expected a different error.
Caught:
(no error)
Expected:
(error)
```
This way, it is a bit clearer that no error was thrown/caught, while an error was expected. If an expected error message is provided, that error message will be displayed instead of ```(error)```. If the function being
tested calls ```error()```, with no arguments, the caught message will display ```(nil)``` instead of ```(no error)```, since ```nil``` is a valid error object.