line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::t::Subclass; |
2
|
|
|
|
|
|
|
$CHI::t::Subclass::VERSION = '0.59'; |
3
|
1
|
|
|
1
|
|
508
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
5
|
1
|
|
|
1
|
|
508
|
use CHI::Test; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use base qw(CHI::Test::Class); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Test declare_unsupported_methods |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
{ |
11
|
|
|
|
|
|
|
package CHI::t::Subclass::Driver::HasUnsupported; |
12
|
|
|
|
|
|
|
$CHI::t::Subclass::Driver::HasUnsupported::VERSION = '0.59'; |
13
|
|
|
|
|
|
|
use Moo; |
14
|
|
|
|
|
|
|
extends 'CHI::Driver::Memory'; |
15
|
|
|
|
|
|
|
__PACKAGE__->declare_unsupported_methods(qw(get_namespaces)); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub test_unsupported : Tests { |
19
|
|
|
|
|
|
|
my $cache = CHI->new( |
20
|
|
|
|
|
|
|
driver_class => 'CHI::t::Subclass::Driver::HasUnsupported', |
21
|
|
|
|
|
|
|
global => 1 |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
lives_ok( sub { $cache->get_keys }, 'get_keys lives' ); |
24
|
|
|
|
|
|
|
throws_ok( |
25
|
|
|
|
|
|
|
sub { $cache->get_namespaces }, |
26
|
|
|
|
|
|
|
qr/method 'get_namespaces' not supported by 'CHI::t::Subclass::Driver::HasUnsupported'/, |
27
|
|
|
|
|
|
|
'get_namespaces dies' |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |