Ovid wrote:
> The idea is, in this scope, we'd convert the 'get_ok' and
> 'content_like' methods to *not* be tests for the current scope. This
> allows us to use our tests as test fixtures rather than duplicate this
> logic.
>
> I think this is a horribly clumsy idea, but the above is a simplifie
Here's an improved interface that lets you do
maybe_test {
your($code);
goes($here};
} $testing_on_or_off;
--
use strict;
use warnings;
use Test::Tester;
use Test::More 'no_plan';
my $delegator = Test::Tester->new_new();
my $capture = Test::Tester->capture();
sub maybe_test(&$)
On Feb 20, 2007, at 9:12 AM, Ovid wrote:
Here's a common enough problem that I assume someone else has solved
it.
[snip]
The idea is, in this scope, we'd convert the 'get_ok' and
'content_like' methods to *not* be tests for the current scope. This
allows us to use our tests as test fixtures
--- Shlomi Fish <[EMAIL PROTECTED]> wrote:
> >
> > sub add_user : Tests(5) {
> > my $test = shift;
> > my $mech = $test->mech;
> >
> > my $override = override_if_fixture(
> > test => $test,
> > mech => $mech,
> > overrides => {
> > get
Shlomi Fish wrote:
> Maybe I'm missing something, but in your second example, you declare
> $override as a lexical and don't use it anywhere. May I inquire what
> was your real intention?
I'm pretty sure he was trying to do this:
add_user.t
$testing = 1;
add_user(); # prints TAP
do_something_tha
Test::Tester allows you to temporarily divert test results to another
test result collector (which you can then throw away). It diverts the
results at the method call level so it's like the diverted tests never
ran (it does NOT capture STDOUT, Test::Tester sticks to the documented
interface, rathe
Hi Ovid!
On 2/20/07, Ovid <[EMAIL PROTECTED]> wrote:
Here's a common enough problem that I assume someone else has solved
it.
Tools in question:
Test::Class
Test::WWW::Mechanize
We want to test creating users (pseudo-code, but close to what we
actually use):
sub add_user : Tests(5) {
Here's a common enough problem that I assume someone else has solved
it.
Tools in question:
Test::Class
Test::WWW::Mechanize
We want to test creating users (pseudo-code, but close to what we
actually use):
sub add_user : Tests(5) {
my $test = shift;
my $mech = $test->mech;