TODO and SKIP tests with Test::WWW::Mech

Greets,

Is it possible to create Test::More-style SKIP and TODO tests with
Test::WWW::Mechanize? Browsing the docs and searching the web didn't
turn up anything.

I suppose it's possible to hack up an approximation using WWW::Mech
and Test::More using the "equivalent" code from Test::WWW::Mech's
synopsis, but maybe there's a better answer.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
marvin [ Fr, 25 Mai 2007 19:31 ] [ ID #1723413 ]

Re: TODO and SKIP tests with Test::WWW::Mech

On May 25, 2007, at 12:31 PM, Marvin Humphrey wrote:

> Is it possible to create Test::More-style SKIP and TODO tests with
> Test::WWW::Mechanize? Browsing the docs and searching the web
> didn't turn up anything.
>
> I suppose it's possible to hack up an approximation using WWW::Mech
> and Test::More using the "equivalent" code from Test::WWW::Mech's
> synopsis, but maybe there's a better answer.

Test::WWW::Mechanize is built on Test::Builder, as is Test::More.
Anything you can do in Test::More, you can do in Test::WWW::Mechanize.

SKIP: {
skip "Not connected to Internet", 5 unless $connected_to_net;

$mech->get_ok( "$lang.wikipedia.org" ) for qw( jp en kr de it );
}


TODO: {
local $TODO = "Haven't worked out handling of text/snarfle
encoding";

$mech->get( "http://example.com/?encoding=snarfle" );
is( $mech->content, 'Success!' );
}

Those are both perfectly valid.

xoxo,
Andy

--
Andy Lester => andy [at] petdance.com => www.petdance.com => AIM:petdance
Andy [ Fr, 25 Mai 2007 19:46 ] [ ID #1723414 ]
Perl » perl.libwww » TODO and SKIP tests with Test::WWW::Mech

Vorheriges Thema: how to postback results to a different URL
Nächstes Thema: Mech 1.30 is up