GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Fork of assert_valid_markup, sped up by using xmllint locally rather than hitting w3c service
Homepage: http://redgreenblu.com/svn/projects/assert_valid_markup/
Clone URL: git://github.com/wr0ngway/assert_valid_markup.git
name age message
file README Mon Aug 04 12:59:57 -0700 2008 add support for local validation via xmllint [wr0ngway]
file Rakefile Mon Aug 04 12:59:57 -0700 2008 add support for local validation via xmllint [wr0ngway]
file init.rb Mon Oct 31 13:38:21 -0800 2005 initial import [scottr]
directory lib/ Mon Aug 04 14:50:45 -0700 2008 fix file url for xmllint native to os x (older ... [wr0ngway]
README
= assert_valid_markup plugin for Rails


Validate your (X)HTML from within your functional tests. If anything changes to invalidate
your markup, you'll know pronto.

If xmllinl/xmlcatalog are available in your PATH, this plugin will use them to validate your xml.
When doing so, it will automatically fetch and cache all DTDs locally so that you don't incur a
network hit on future runs.

Otherwise, validations will be done using the W3C Validator web service (http://validator.w3.org/).
Responses from the web service are cached, so your tests aren't slowed down unless something has changed.

== Usage

  # 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 "<div>Hello, world.</div>"
      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

== Credits

Scott Raymond <sco@scottraymond.net>. Released under the MIT license.
Matt Conway <matt@conwaysplace.com> (xmllint additions)
Latest version: http://github.com/wr0ngway/assert_valid_markup