alphagov / tech-docs-gem

Gem to distribute the tech docs project
https://tdt-documentation.london.cloudapps.digital/
MIT License
15 stars 38 forks source link

Fail tests if the middleman site doesn't build properly #92

Closed tijmenb closed 5 years ago

tijmenb commented 5 years ago

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).