File: 03croak.t

package info (click to toggle)
librole-commons-perl 0.104-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: perl: 247; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (6)
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';