TODO and SKIP tests with Test::WWW::Mech
am 25.05.2007 19:31:52 von marvin
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/
Re: TODO and SKIP tests with Test::WWW::Mech
am 25.05.2007 19:46:50 von Andy
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@petdance.com => www.petdance.com => AIM:petdance