G
Gunnar Strand
Hi,
I am trying to write test cases using Test::Unit, and one of the
test object starts like this:
1 package Test::TestProfileSettings;
2
3 use Cmpm:
rofile::Settings;
4 use Test::Unit::TestCase;
5 use base qw( Test::Unit::TestCase );
6
7 sub new {
8 my $class = shift;
9 my $self = $class -> SUPER::new( @_ );
10 return $self;
11 }
12
13 sub test_settings1 {
14 my $self = shift;
15 my $s = Cmpm:
rofile::Settings -> new;
16 print STDERR "\$s = $s\n";
...more code below, but this is the only method...
I use a TestSuite to run several test objects. If I run one certain
test case before the one above, then perl complains:
Test/TestProfileSettings.pm:15 - test_settings1(Test::TestProfileSettings)
Can't call method "new" on unblessed reference
It seems odd to me that perl would consider the class name to be
an unblessed reference. If the test cases run in a different order,
then all passes without any errors. Has anyone seen this before,
and has any idea on what could be wrong?
Kind Regards,
/Gunnar
I am trying to write test cases using Test::Unit, and one of the
test object starts like this:
1 package Test::TestProfileSettings;
2
3 use Cmpm:
4 use Test::Unit::TestCase;
5 use base qw( Test::Unit::TestCase );
6
7 sub new {
8 my $class = shift;
9 my $self = $class -> SUPER::new( @_ );
10 return $self;
11 }
12
13 sub test_settings1 {
14 my $self = shift;
15 my $s = Cmpm:
16 print STDERR "\$s = $s\n";
...more code below, but this is the only method...
I use a TestSuite to run several test objects. If I run one certain
test case before the one above, then perl complains:
Test/TestProfileSettings.pm:15 - test_settings1(Test::TestProfileSettings)
Can't call method "new" on unblessed reference
It seems odd to me that perl would consider the class name to be
an unblessed reference. If the test cases run in a different order,
then all passes without any errors. Has anyone seen this before,
and has any idea on what could be wrong?
Kind Regards,
/Gunnar