gabrielfalcao/lettuce — pull request #235 by itsmonktastic (2012-03-09 23:40:22+00:00)
Title: Correctly colour output of wrapped lines

After a step passes or fails, the intention seems to be that it should change colour. E.g.

**before step:**
```When I do something````

**after step:**
```When I do something```

This works fine except when the step description is longer than the width of the terminal, where instead of changing the colour, a new line is added with the intended colour, e.g.

**before step:**
```When I do so
mething```

**after step:**
```When I do so
mething
When I do so
mething```

Definitely a problem in Windows/Linux, not sure if this was a problem with OSX's terminal app.

This pull request contains a patch to resolve this problem. It does however cause the functional tests to be sensitive to the size of the terminal they're running in (if the terminal is too small, a lot of the assertions about escape codes output by the tools will fail as they rely on the the assumption that no wrapping occurs).

Not sure what the best way would be to fix this so that they can run independent of the terminal. Two solutions I can think of:

1. The tests could make decisions on what escape codes to expect based on the current terminal size
2. The tests could actually create different size terminals to run the functional tests in with sizes that match the test assertions.