Add formatter regression tests rebased

This is #1292 rebased as discussed.  Besides the basic rebase I also ammended one of your commits (7e6f2734b45c03c65340430ce74db5ce832e5722) to make it include a corresponding spec (see 4c43e1c88ed5626d773ee5360c1457c8b009feed).

I was going to force push this but I'm noticing some spec failures locally that I don't get from the #1282 branch.  Not sure why but it's late so I'm just pushing this so I can go to bed.