File: 01basic.t

package info (click to toggle)
librole-commons-perl 0.104-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 196 kB
  • ctags: 21
  • sloc: perl: 247; makefile: 17
file content (44 lines) | stat: -rw-r--r-- 717 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
use Test::More;

BEGIN {
	package Local::Class;
	use Role::Commons -all;
	our $AUTHORITY = 'http://www.example.com/';
	our $VERSION   = '42.0';
	sub new  { bless [], shift };
	sub bumf { 123 };
}

my $obj = new_ok 'Local::Class';
can_ok $obj => $_ for qw( AUTHORITY tap object_id does );

is(
	Local::Class->AUTHORITY,
	'http://www.example.com/',
	'AUTHORITY get',
);

ok(
	Local::Class->AUTHORITY('http://www.example.com/'),
	'AUTHORITY assert',
);

ok(
	!eval { Local::Class->AUTHORITY('http://www.example.net/') },
	'AUTHORITY assert (failure)',
);

is(
	Local::Class->tap('bumf'),
	'Local::Class',
	'tap',
);

isnt(
	Local::Class->new->object_id,
	Local::Class->new->object_id,
	'object_id',
);

done_testing();