dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that I have classes that have waaaay more functionality than can be tested in one file. So, the recommended organisation of Foo::Bar::Test testing Foo::Bar isn't going to work.
What I'm thinking of is writing test classes that encapsulate tests given a certain setup. So, something like:
Then, in my test file, I could have something like:package Test::Floober; # This inherits from Test::Class use base 'My::Test::BaseClass'; sub test1 : Test(5) { my $self = shift; # Do stuff here with $self->{foo} and $self->{bar} # that were passed in at new() }
I got a couple questions:use Test::Floober; my $test = Test::Floober->new( foo => 2, bar => 5 ); my $test2 = Test::Floober->new( foo => 'abcd', bar => [ 2 .. 5 ] ); Test::Class->runtests( $test, $test2 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::Class and test organization
by Herkum (Parson) on Mar 21, 2006 at 17:46 UTC | |
by dragonchild (Archbishop) on Mar 21, 2006 at 18:42 UTC | |
by xdg (Monsignor) on Mar 22, 2006 at 03:15 UTC | |
by dragonchild (Archbishop) on Mar 22, 2006 at 03:51 UTC | |
by xdg (Monsignor) on Mar 22, 2006 at 05:54 UTC | |
by Herkum (Parson) on Mar 22, 2006 at 13:42 UTC | |
| |
by adrianh (Chancellor) on Mar 22, 2006 at 11:30 UTC | |
|
Re: Test::Class and test organization
by adrianh (Chancellor) on Mar 22, 2006 at 11:12 UTC |