1 package SL::BackgroundJob::SelfTest::Base;
7 use parent qw(Rose::Object);
9 use Rose::Object::MakeMethods::Generic (
10 'scalar --get_set_init' => 'tester',
15 die 'needs to be overwritten';
39 SL::BackgroundJob::SelfTests::Base - Base class for background job self tests.
44 use parent qw(SL::BackgroundJob::SelfTests::Base);
46 # optionally use a different tester
55 $self->tester->plan(tests => 1);
57 $self->tester->ok($value_from_database == $expected_value, 'short explanation');
62 This is a base class for self tests.
66 Your class will inherit L<Rose::Object> so you can use the class building utils
67 from there, and won't need to worry about writing a new constructor.
69 Your test will be instanciated and the run method will be invoked. The output
70 of your tester object will be collected and processed.
80 If you don't bother overriding C<init_tester>, your test will use a
81 L<Test::More> object by default. Any other L<Test::Builder> object will do.
83 The TAP output of your builder will be collected and processed for further handling.
89 If a self test module dies, it will be recorded as failed, and the bubbled
90 exception will be used as diagnosis.
94 It is currently not possible to indicate if a test skipped (indicating no actual testing was done but it wasn't an error) nor returning a todo status (indicating that the test failed, but that being ok, because it's a todo).
96 Stub methods "todo" and "skipped" exist, but are currently not used.
100 Sven Schoeling E<lt>s.schoeling@linet-services.deE<gt>