Try my gem, html_acceptance . It uses HTML Tidy to perform validation under the hood. I did this a long time ago, but so far it has gone unnoticed. It was useful to me, and if you report problems / receive feature requests, I will be happy to look at them.
In the samples, I have a custom RSpec mapping, so if you add this custom matches, in your integration tests in specifications / queries you can:
page.should have_valid_html
The idea is that you can use it in integration tests, and even if you get minor warnings / crashes that you don't need (for example, TIDY complains about some IE hacks), you can log in, accept them, and for now the result verification will be constant, the test will then pass.
In addition, you need to be careful on the way. So, OS X: install the htmltidy port or Ubuntu sudo apt-get install tidy port.
ebeland
source share