File: 100.CreateBook.t

package info (click to toggle)
publican 4.3.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,436 kB
  • sloc: javascript: 17,390; perl: 13,081; xml: 11,558; makefile: 160; sh: 60; python: 29
file content (44 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (5)
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 strict;
use warnings;

use Test::More tests => 10;

BEGIN {
    use_ok('Publican');
    use_ok('Publican::CreateBook');
}

my $creator = Publican::CreateBook->new( { name => 'Test_Book' } );
isa_ok( $creator, 'Publican::CreateBook', 'creating a Publican::CreateBook' );

eval { $creator->create() };
my $e = $@;
ok( ( not $e ), "create a book" );
diag($e) if $e;

$creator = Publican::CreateBook->new(
    { name => 'Test_Article', type => 'Article' } );
isa_ok( $creator, 'Publican::CreateBook', 'creating a Publican::CreateBook' );

eval { $creator->create() };
$e = $@;
ok( ( not $e ), "create an article" );
diag($e) if $e;

$creator = Publican::CreateBook->new( { name => 'Test_Set', type => 'Set' } );
isa_ok( $creator, 'Publican::CreateBook', 'creating a Publican::CreateBook' );

eval { $creator->create() };
$e = $@;
ok( ( not $e ), "create a set" );
diag($e) if $e;
$creator = undef;

my $creator2 = Publican::CreateBook->new( { name => 'Test_DB5_Book', dtdver => '5.0' } );
isa_ok( $creator2, 'Publican::CreateBook', 'creating a Publican::CreateBook' );

eval { $creator2->create() };
$e = $@;
ok( ( not $e ), "create a DB5 book" );
diag($e) if $e;