Responsible Markup plugin

Plugin details

A plugin which provides tests for (X)HTML markup validity, Unobtrusive Javascript, Backwards-compatible XHTML and other hallmarks of responsible web development

Websitehttp://blog.codahale.com/2006/03/05/responsiblemarkup-v01-unit-test-your-way-to-responsible-markup/ Repositoryhttp://svn.codahale.com/responsible_markup/trunk Author Coda Hale Tags Markup, Javascript, HTML LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.codahale.com/responsible_markup/trunk

Using Your Own Validator
=======================

If you're using this often (as you should be), you should go ahead and install a local copy of the W3C Validator. Doing this will speed up your tests as well as reduce the load on the public W3C Validator. assert_valid_html caches the results in the temp directory, but any large set of tests will generate upwards of a hundred requests. It makes sense to have the time per request as low as possible.

To install the W3C Validator on a local server, follow these instructions:
http://validator.w3.org/docs/install.html

To use a local validator, follow this example:

  require 'test/unit'
  
  class ValidityTest < Test::Unit::TestCase
    ResponsibleMarkup::validator_uri = 'http://127.0.0.1/validator/check'
   
    def setup
      html_content = generated_by_magic_process(:go_go_xhtml)
    end
  
    def test_validity
      assert_valid_html(html_content, "http://foo/bar/squee isn't valid XHTML")
    end
  end

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago