As we're currently seeing in https://github.com/alphagov/tech-docs-gem/pull/89, when middleman encounters errors during the build of the example site, the tests will still pass as long as the HTML is correctly generated.
With this commit, we change that behaviour to fail whenever middleman build encounters a problem. This will prevent us from merging in code that will prevent the CSS and JS from being built, as is happening in the aforementioned PR.
As we're currently seeing in https://github.com/alphagov/tech-docs-gem/pull/89, when middleman encounters errors during the build of the example site, the tests will still pass as long as the HTML is correctly generated.
With this commit, we change that behaviour to fail whenever
middleman build
encounters a problem. This will prevent us from merging in code that will prevent the CSS and JS from being built, as is happening in the aforementioned PR.As a bonus, I've DRY-ed up the testing code, improved the test output, and sped up the tests by using NO_CONTRACTS (see https://github.com/alphagov/govuk-developer-docs/pull/1532 for more info).