Forum: Ruby on Rails Re: automated markup validation

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Scott R. (Guest)
on 2006-01-30 19:44
(Received via mailing list)
Paul B. wrote:
> This is a great idea, I'm going to give it a try.  Does anyone know if
> there is a way to accomplish this wthout having to send an HTTP request
> to <>?  It would be nice to write functional test
> that will pass even when you're not connected to the internet.  Is there
> a ruby xhtml validation library?

The assert_valid_markup plugin now catches SocketError exceptions, so
that the assertion will pass if there's temporarily no connection.
Plus, it caches responses from the W3C validator, so it only makes a
connection if the markup has changed.

It also has class-level methods, so you can do things like:

  class FooControllerTest < Test::Unit::TestCase
    assert_valid_markup :home_page, :another_page
    assert_valid_markup :some_private_page, :but_first => :login

The plugin lives here:

As such, this should install it for you:

   script/plugin install

Scott R.
This topic is locked and can not be replied to.