File Coverage: t/01-basic.t

# File Coverage

File: | t/01-basic.t
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 | 1 1 1 |  |  | 1 |  | 4642 1 24 | use strict;
2 | 1 1 1 |  |  | 1 |  | 3 1 35 | use warnings;
3 |
4 | 1 1 1 |  |  | 1 |  | 587 115949 9 | use Test::More q//;
5 |
6 | 1 1 1 |  |  | 1 |  | 716 1430 149 | use FindBin qw/$Bin/;
7 | 1 1 1 |  |  | 1 |  | 376 867 8 | use lib qq{$Bin/lib};
8 | 1 1 1 |  |  | 1 |  | 458 2 1528 | use Foo;
9 |
10 | 1 |  |  |  |  | 95271 | my $foo = Foo->new( some => q{thing} );
11 |
12 | 1 |  |  |  |  | 3 | is ref $foo, q{Foo::_1}, q{ref returns expected internalized package string};
13 | 1 |  |  |  |  | 294 | is $foo->some, q{thing}, q{value returned by top level accessor};
14 | 1 |  |  |  |  | 215 | is $foo->boop, q{boop}, q{value returned by predefined method package (boop)};
15 | 1 |  |  |  |  | 209 | is $foo->beep, q{beep}, q{value returned by predefined method package (beep)};
16 | 1 |  |  |  |  | 204 | is $foo->bar(4), 4, q{no error setting value with default accessor};
17 |
18 | 1 |  |  |  |  | 218 | my $foo2 = Foo->new( some => q{thang} );
19 |
20 | 1 |  |  |  |  | 11 | is ref $foo2, q{Foo::_2}, q{ref returns expected internalized package string};
21 | 1 |  |  |  |  | 204 | is $foo2->some, q{thang}, q{value returned by top level accessor};
22 | 1 |  |  |  |  | 208 | is $foo2->boop, q{boop}, q{value returned by predefined method package (boop)};
23 | 1 |  |  |  |  | 211 | is $foo2->beep, q{beep}, q{value returned by predefined method package (beep)};
24 | 1 |  |  |  |  | 204 | is $foo2->bar(12), 12, q{no error setting value with default accessor};
25 |
26 | 1 |  |  |  |  | 203 | isnt $foo2->bar, $foo->bar, q{multiple instances of Foo donut conflict};
27 |
28 | 1 |  |  |  |  | 210 | my $foo_deeply = Foo->new( some => q{thing}, more => { other => q{things} } );
29 | 1 |  |  |  |  | 3 | is ref $foo_deeply, q{Foo::_3}, q{ref returns expected internalized package string};
30 | 1 |  |  |  |  | 215 | is $foo_deeply->more->other, q{things}, q{value returned by nested hash reference provided to constructor};
31 |
32 | 1 |  |  |  |  | 209 | done_testing;