/[webpac2]/trunk/t/5-output-webpacus.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/5-output-webpacus.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 949 - (hide annotations)
Thu Nov 1 00:16:48 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: application/x-troff
File size: 851 byte(s)
 r1433@llin:  dpavlin | 2007-10-31 22:48:02 +0100
 HUGE swiping changes to implement new testing architecture
 based on all new WebPAC::Test module which makes
 test writing a joy

1 dpavlin 932 #!/usr/bin/perl -w
2    
3 dpavlin 949 use strict;
4 dpavlin 932 use blib;
5    
6 dpavlin 949 use Test::More tests => 10;
7    
8 dpavlin 932 BEGIN {
9 dpavlin 949 use_ok( 'WebPAC::Test' );
10 dpavlin 932 use_ok( 'WebPAC::Output::Webpacus' );
11     }
12    
13     ok(my $out = new WebPAC::Output::Webpacus({
14     path => '/data/Webpacus2/',
15     database => 'test',
16     clean => 1,
17 dpavlin 949 %LOG
18 dpavlin 932 }), "new");
19    
20     ok( $out->init, 'init' );
21    
22     my $ds = {
23     'Source' => {
24     'name' => 'Izvor: ',
25     'sorted' => [ 'foo' ]
26     },
27     'ID' => {
28     'sorted' => 'id',
29     },
30     'Array' => {
31     'sorted' => [ qw/a1 a2 s3 a4 a5/ ],
32     },
33     };
34    
35     throws_ok { $out->add( ) } qr/need id/, 'add without params';
36     throws_ok { $out->add( 42 ) } qr/need ds/, 'add without ds';
37    
38     ok( $out->add( 42, $ds ), 'add 42' );
39    
40     ok( $out->add( 99, { foo => { sorted => 'bar' } } ), 'add 99' );
41    
42     ok( $out->add( 100, { foo => { sorted => [ qw/foo bar baz/ ] } } ), 'add 100' );
43    
44 dpavlin 949 diag "path: ",$out->path if $debug;
45 dpavlin 932
46     ok( $out->finish, 'finish' );
47    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26