File: 03_methods.t

package info (click to toggle)
libsvg-tt-graph-perl 0.14-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 412 kB
  • ctags: 186
  • sloc: perl: 5,564; makefile: 2
file content (31 lines) | stat: -rwxr-xr-x 814 bytes parent folder | download
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
use lib qw( ./blib/lib ../blib/lib );

# Test using the methods to set the config

use Test::More tests => 12;

BEGIN { use_ok( 'SVG::TT::Graph' ); }
BEGIN { use_ok( 'SVG::TT::Graph::Line' ); }

my @fields = qw(Jan Feb Mar);

my $graph = SVG::TT::Graph::Line->new({
  'fields' => \@fields,
});

is($graph->show_y_labels(),1,'default show_y_labels match');
is($graph->show_y_labels('0'),0,'setting show_y_labels match');
is($graph->show_y_labels(),0,'new show_y_labels match');

eval {
  $graph->silly_method_that_dont_exist();
};
ok($@, 'Got error for method that is not in config');

ok(defined $graph->compress(),'default compress');
is($graph->compress(0),0,'setting compress');
is($graph->compress(1),1);

ok(defined $graph->tidy(),'default tidy');
is($graph->tidy(0),0,'setting tidy');
is($graph->tidy(1),1);