Forum: Ruby on Rails Re: automated markup validation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0329f0570f4160517ec52060f9566cdf?d=identicon&s=25 Scott Raymond (Guest)
on 2006-01-30 18:44
(Received via mailing list)
Paul Barry 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 w3.org <http://w3.org>?  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
  end

The plugin lives here:
http://redgreenblu.com/svn/projects/assert_valid_markup/

As such, this should install it for you:

   script/plugin install
http://redgreenblu.com/svn/projects/assert_valid_markup

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