/[webpac2]/trunk/t/2-parse.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

Diff of /trunk/t/2-parse.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 948 by dpavlin, Sun Oct 8 20:28:17 2006 UTC revision 949 by dpavlin, Thu Nov 1 00:16:48 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
 use Test::More tests => 55;  
 use Test::Exception;  
4  use blib;  use blib;
5    
6  use Data::Dump qw/dump/;  use Test::More tests => 55;
7  use Cwd qw/abs_path/;  
8  use YAML qw/LoadFile/;  use YAML qw/LoadFile/;
9    
10  BEGIN {  BEGIN {
11    use_ok( 'WebPAC::Test' );
12  use_ok( 'WebPAC::Parser' );  use_ok( 'WebPAC::Parser' );
13  use_ok( 'WebPAC::Config' );  use_ok( 'WebPAC::Config' );
14  }  }
15    
 my $debug = shift @ARGV;  
   
 ok(my $abs_path = abs_path($0), "abs_path");  
 $abs_path =~ s#/[^/]*$#/#;  
   
16  my $config_path = "$abs_path/conf/test.yml";  my $config_path = "$abs_path/conf/test.yml";
17    
18  ok(-e $config_path, "$config_path exists");  ok(-e $config_path, "$config_path exists");
19    
20  throws_ok { new WebPAC::Parser( no_log => 1 ) } qr/WebPAC::Config/, "new without config";  throws_ok { new WebPAC::Parser( %LOG ) } qr/WebPAC::Config/, "new without config";
21    
22  ok(  ok(
23          my $parser = new WebPAC::Parser(          my $parser = new WebPAC::Parser(
24                  config => new WebPAC::Config( path => $config_path ),                  config => new WebPAC::Config( path => $config_path ),
25                  base_path => $abs_path,                  base_path => $abs_path,
26                  debug => $debug,                  %LOG
27  ), "new");  ), "new");
28    
29  my $inputs = {  my $inputs = {
# Line 120  ok( Line 114  ok(
114          my $parser = new WebPAC::Parser(          my $parser = new WebPAC::Parser(
115                  config => new WebPAC::Config( path => $config_path ),                  config => new WebPAC::Config( path => $config_path ),
116                  base_path => $abs_path,                  base_path => $abs_path,
117                  debug => $debug,                  %LOG,
118  ), "new");  ), "new");
119    
120  ok(my $marc = $parser->have_rules('marc', 'marc', 'marc-input'), 'have_rules(marc,...)');  ok(my $marc = $parser->have_rules('marc', 'marc', 'marc-input'), 'have_rules(marc,...)');

Legend:
Removed from v.948  
changed lines
  Added in v.949

  ViewVC Help
Powered by ViewVC 1.1.26