[Perlunit-devel] Can't locate object method "new" via package "Test::Unit::Assertion::Boolean"
Status: Beta
Brought to you by:
mca1001
|
From: Malcolm B. <ma...@br...> - 2002-03-03 16:45:47
|
Hi,
I'm stumped trying to get Test::Unit to work with a very simple example.
I get the error "Can't locate object method "new" via package
"Test::Unit::Assertion::Boolean"" when I try the following simple module:
package Me;
use strict;
use Test::Unit;
use base qw(Test::Unit::TestCase);
sub new {
my $self = shift()->SUPER::new(@_);
$self->{config} = 0;
$self->quell_backtrace();
return $self;
}
sub test_creation {
my $self = shift;
$self->assert( 1 == 1);
}
sub set_up {
}
sub tear_down {
}
1;
Running this with "perl TestRunner.pl Me" results in massive error
backtraces of the form:
Can't locate object method "new" via package
"Test::Unit::Assertion::Boolean" (perhaps you forgot to load
"Test::Unit::Assertion::Boolean"?) at
/usr/local/share/perl/5.6.1/Test/Unit/Assert.pm line 18.
Level 1: in package 'Test::Unit::TestResult', file
'/usr/local/share/perl/5.6.1/Test/Unit/TestResult.pm', at line '99', sub
'Test::Unit::TestCase::run_bare'
Level 2: in package 'Test::Unit::TestResult', file
'/usr/local/share/perl/5.6.1/Test/Unit/TestResult.pm', at line '109',
sub 'Test::Unit::TestResult::__ANON__'
Level 3: in package 'Test::Unit::TestResult', file
'/usr/local/share/perl/5.6.1/Test/Unit/TestResult.pm', at line '108',
sub '(eval)'
Level 4: in package 'Test::Unit::TestResult', file
'/usr/local/share/perl/5.6.1/Test/Unit/TestResult.pm', at line '99', sub
'Test::Unit::TestResult::run_protected'
The weird thing is that I can make Test::Unit work with the simple
procedural interface, and it passes AllTests on my installation. But
for the life of me I can't see what's wrong with what I'm doing.
Any help would be v. gratefully received,
Malcolm
|