On 15 Sep 2008, at 23:16, Zach Dennis wrote:

On Mon, Sep 15, 2008 at 5:32 PM, Jonathan Linowes
<[EMAIL PROTECTED]> wrote:
Hi,
suggestions how to add w3 validation to a story step?
eg
Then the page should be valid


You could write a "then" step that takes the current response.body,
uploads it to the w3 validator, and checks the the response. Rather
than uploading you could use the ruby tidy bindings to do offline
validation which would most likely be much faster. See
http://tidy.rubyforge.org/ for more information.

I'd love to see such a thing if you did make it.

The other day, I got around this issue (I forgot to close a tag somewhere and the page didn't render in safari) by writing a matcher be_valid_xml() which just tried to load the response.body into an XML document. That was enough to catch my bug, but this would be a great tool to have in the box.

cheers,
Matt
----
http://blog.mattwynne.net
http://songkick.com

In case you wondered: The opinions expressed in this email are my own and do not necessarily reflect the views of any former, current or future employers of mine.



_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to