[jifty-devel] I'm designing a DSL for jifty's web testing...

Edmund von der Burg evdb at ecclestoad.co.uk
Wed Jan 17 03:09:53 EST 2007

Using Test::WWW::Mechanize you can do:

  $mech->content_like( $regex [, $desc ] );

which I find very elegant, especially as it easily lets you play with
two mechs at once which can be good for checking interactions between
two users on one site.

What are the more involved cases that are making you think of creating
a DSL rather than trying to extend Test::WWW::Mech?

On 17/01/07, Jesse Vincent <jesse at fsck.com> wrote:
>        check { content matches qr{fsck.com} };
>        content should match qr{fsck.com};
>        ok($mech->content =~ qr{fsck.com});

>        content matches qr{fsck.com};

This I find the least ambiguos of the DSL variants - it is easy to
read. However it could be even simpler for this case (if it is to be a
true DSL then my granny should be able to read it and understand it):

content contains 'fsck.com';

>        content should_match qr{fsck.com};
>        check { content =~ qr{fsck.com} };
>        check: content =~ qr{fsck.com};
>        check( content =~ qr{fsck.com} );
>  any of those better than any others?

Possibly interesting talk on roughly this topic:


More information about the jifty-devel mailing list