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