[LRUG] Meeting August 8th and September 4th

A. S. Bradbury asbradbury at tekcentral.org
Tue Aug 15 08:10:48 PDT 2006


On Monday 14 August 2006 23:07, Tiest Vilee wrote:
> Yeah - sounds great.
> BTW I have been thinking about trying to set up a testing framework for
> my QAs where they can specify 'I want the HTML to look something like
> this' but not have to be exact about all of it - like a fuzzy regexp for
> xhtml.  Is the stuff you are working on at all related to that problem?
>
> Tiest

I don't think Ariel's rule learning capabilities would be very useful, but the 
tokenizer is very intuitive and easy to customize, so you might modify that 
somewhat and add some custom wildcards, and hand-write some Ariel rules. A 
rule is composed of landmarks, for instance:
Ariel::Rule.new [[:html_tag, "example"], [:numeric]], :forward
Is a rule applied from the front of the document that will skip to the first 
place in the document where there is a token that matches the :html_tag 
wildcard followed immediately by a token with the text "example" (that is one 
landmark with two features). From that position, it will then move to the 
next point where there is a token that matches the :numeric wildcard. This 
idea of a fuzzy test meshes will with the idea of searching for particular 
landmarks I think. I think that Ariel's approach to tokenization (which 
should be very trivial to customise, even if this isn't very well exposed at 
the moment) and the rule language might make a useful tool to do what you 
want. Very interesting.

Apologies if my explanation isn't clear above, I wrote it a little quickly.

I personally like the look of Luke Redpath's approach of using Hpricot to test 
rails views, take a look at 
http://www.lukeredpath.co.uk/index.php/2006/07/07/testing-your-rails-views-with-hpricot/
>    assert element('body').should_contain('My Funky Website')

In conclusion, this isn't a conventional usage of Ariel (where the focus is on 
learning rules), but you could probably make it do what you wish relatively 
easily, and check out the link above.

Alex



More information about the Chat mailing list