1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
package Local::MyTest;
our $AUTHORITY = 'http://example.net/';
package main;
use Test::More tests => 7;
use Test::Exception;
use Object::AUTHORITY -package => 'Local::MyTest';
dies_ok
{ Local::MyTest->AUTHORITY('cpan:TOBYINK') }
'dies passed string';
dies_ok
{ Local::MyTest->AUTHORITY(qr/^cpan:/i) }
'dies passed regexp';
dies_ok
{ Local::MyTest->AUTHORITY(undef) }
'dies passed undef';
dies_ok
{ Local::MyTest->AUTHORITY(['mailto:joe@example.net' , qr/^cpan:/i]) }
'dies passed arrayref';
lives_ok
{ Local::MyTest->AUTHORITY('http://example.net/') }
'lives passed string';
lives_ok
{ Local::MyTest->AUTHORITY(qr/^http:/i) }
'lives passed regexp';
lives_ok
{ Local::MyTest->AUTHORITY(['mailto:joe@example.net' , qr/^cpan:/i, 'http://example.net/']) }
'lives passed arrayref';
|