File Coverage

File:t/00.load.t
Coverage:100.0%

linestmtbrancondsubpodtimecode
1
1
1
1
1199
9351
9
use Test::More tests => 18;
2
1
1
1
257
1
34
use Data::Dumper;
3
1
1
1
3
2
17
use File::Spec;
4
5BEGIN {
6
1
7
      use_ok( 'Pipeline::Simple' );
7}
8
9sub test_input_file {
10
1
21
    return File::Spec->catfile('t', 'data', @_);
11}
12
13
1
130520
diag( "Testing Pipeline::Simple methods in memory" );
14
15# debug ignores the missing config file
16
1
127
my $p = Pipeline::Simple->new(debug => 1, verbose => -1);
17
1
7
ok ref($p) eq 'Pipeline::Simple', 'new()';
18
19
1
235
my $s2 = Pipeline::Simple->new(id=> 'S2', debug => 1, verbose => -1);
20
1
7
ok ref($s2) eq 'Pipeline::Simple', 'new()';
21
22# method testing
23
1
273
can_ok $p->add($s2), 'add';
24
1
259
ok $s2->id() eq 'S2', 'id()';
25
1
177
ok $s2->name('test'), 'name()';
26
1
265
ok $s2->name() eq 'test', 'name()';
27
1
184
ok $s2->path('/opt/scripts'), 'path()';
28
1
177
ok $s2->path() eq '/opt/scripts', 'path()';
29
1
177
ok $s2->description('test'), 'description()';
30
1
178
ok $s2->next_id('test'), 'next_id()';
31
1
180
ok $s2->dir('data'), 'dir()';
32
1
176
ok $s2->config(test_input_file('string_manipulation.xml')), 'config()';
33
1
346
ok $s2->input('test'), 'input()';
34
1
178
ok $s2->itype('test'), 'itype()';
35
36#ok $s2->run('test'), 'run()';
37
1
180
my $dot = $s2->graphviz;
38
1
19735
ok $dot =~ /^digraph /, 'graphviz()';
39
40
1
394
ok $s2->each_step, 'each_step';
41
42
43
44
1
180
my @methods = qw(id name description next_id config add
45                 run input itype
46               );
47
1
11
can_ok 'Pipeline::Simple', @methods;
48
49
50# # Various ways to say "ok"
51# ok($got eq $expected, $test_name);
52#
53# is ($got, $expected, $test_name);
54# isnt($got, $expected, $test_name);
55#
56# # Rather than print STDERR "# here's what went wrong\n"
57# diag("here's what went wrong");
58#
59# like ($got, qr/expected/, $test_name);
60# unlike($got, qr/expected/, $test_name);
61#
62# cmp_ok($got, '==', $expected, $test_name);
63#
64# can_ok($module, @methods);
65# isa_ok($object, $class);
66#
67# pass($test_name);
68# fail($test_name);
69