Re: Generating test data and testing it

2007-02-21 Thread A. Pagaltzis
* Michael G Schwern <[EMAIL PROTECTED]> [2007-02-20 20:55]: > Finally, why turn off the tests? Why not just let them run? That was my first instinct also. Regards, -- Aristotle Pagaltzis //

Re: Generating test data and testing it

2007-02-20 Thread Michael G Schwern
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

Re: Generating test data and testing it

2007-02-20 Thread Fergal Daly
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(&$)

Re: Generating test data and testing it

2007-02-20 Thread Chris Dolan
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

Re: Generating test data and testing it

2007-02-20 Thread Ovid
--- 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

Re: Generating test data and testing it

2007-02-20 Thread Jonathan Rockway
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

Re: Generating test data and testing it

2007-02-20 Thread Fergal Daly
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

Re: Generating test data and testing it

2007-02-20 Thread Shlomi Fish
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) {

Generating test data and testing it

2007-02-20 Thread Ovid
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;