Assert Valid Markup plugin

Plugin details

Validate your (X)HTML against the W3C Validator web service (http://validator.w3.org/) from within your functional tests. If anything changes to invalidate your markup, you'll know pronto. Responses from the web service are cached, so your tests aren't slowed down unless something has changed.

Repositoryhttp://redgreenblu.com/svn/projects/assert_valid_markup/ Author Scott Raymond Tags HTML, validation LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://redgreenblu.com/svn/projects/assert_valid_markup/
  # Calling the assertion with no parameters validates whatever is in @request.body,
  # which is automatically set by the existing get/post/etc helpers. For example:

    class FooControllerTest < Test::Unit::TestCase
      def test_bar_markup
        get :bar
        assert_valid_markup
      end
    end

  # Add a string parameter to the assertion to validate any random fragment. Por ejemplo:

    class FooControllerTest < Test::Unit::TestCase
      def test_bar_markup
        assert_valid_markup "Hello, world."
      end
    end

  # For the ultimate in convenience, use the class-level method to validate a slew of
  # actions in one line. Par exemple:

    class FooControllerTest < Test::Unit::TestCase
      assert_valid_markup :bar, :baz, :qux
    end

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

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