Alex 'AdUser' Z
9 years ago
1 changed files with 30 additions and 0 deletions
@ -0,0 +1,30 @@
|
||||
use strict; |
||||
use warnings; |
||||
|
||||
use Test::More tests => 5; |
||||
|
||||
require_ok('Subtitle::BASE'); |
||||
|
||||
{ |
||||
package Subtitle::Dummy; |
||||
use strict; |
||||
use warnings; |
||||
use base 'Subtitle::BASE'; |
||||
|
||||
sub new { |
||||
my $class = shift; |
||||
my $self = { log => [] }; |
||||
return bless ($self, $class); |
||||
}; |
||||
1; |
||||
} |
||||
|
||||
my $obj = Subtitle::Dummy->new; |
||||
isa_ok($obj, 'Subtitle::Dummy'); |
||||
|
||||
is(scalar @{ $obj->{log} }, 0); |
||||
$obj->log(warn => "something"); |
||||
is(scalar @{ $obj->{log} }, 1); |
||||
is($obj->{log}->[0], 'W: something'); |
||||
|
||||
exit 0; |
Loading…
Reference in new issue