File: | t/model-repository.t |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | #!/usr/bin/perl | ||||||
2 | 1 1 | 1941 2 | use 5.12.1; | ||||
3 | |||||||
4 | 1 1 1 | 154 283 3 | use lib 't/lib'; | ||||
5 | 1 1 1 | 192 3 2 | use Yukki::Test; | ||||
6 | |||||||
7 | 1 1 1 | 338 1 13 | use Test2::V0; | ||||
8 | |||||||
9 | 1 1 1 1 1 1 1 | 760 12333 5 452 3 1 9 | use ok('Yukki'); | ||||
10 | |||||||
11 | 1 | 93414 | yukki_setup; | ||||
12 | 1 | 81 | yukki_git_init('main'); | ||||
13 | |||||||
14 | 1 | 31 | my $app = Yukki->new; | ||||
15 | 1 | 1965 | my $repo = $app->model(Repository => { name => 'main' }); | ||||
16 | |||||||
17 | 1 | 2254 | isa_ok($repo, 'Yukki::Model'); | ||||
18 | 1 | 255 | isa_ok($repo, 'Yukki::Model::Repository'); | ||||
19 | |||||||
20 | 1 | 180 | is($repo->name, 'main', 'name is main'); | ||||
21 | 1 | 509 | is($repo->title, 'Main', 'title is Main'); | ||||
22 | 1 | 433 | is($repo->branch, 'refs/heads/master', 'branch is refs/heads/master'); | ||||
23 | 1 | 1327 | like($repo->repository_path, qr{/repositories/main\.git$}, 'sane repository_path'); | ||||
24 | |||||||
25 | 1 | 505 | isa_ok($repo->git, 'Git::Repository'); | ||||
26 | |||||||
27 | 1 | 332 | is($repo->author_name, 'Anonymous', 'author is Anonymous'); | ||||
28 | 1 | 703 | is(''.$repo->author_email, 'anonymous@localhost', 'author is anonymous@localhost'); | ||||
29 | |||||||
30 | 1 | 537 | done_testing; |