There's a lot of (good) logic in here, but no tests for it -- did you stop doing TDD because of the problem with the `expect`?