/[webpac2]/trunk/t/0-common.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/0-common.t

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

revision 856 by dpavlin, Sun May 27 16:00:26 2007 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 => 6;  
 use Test::Exception;  
4  use blib;  use blib;
5    
6  use Data::Dump qw/dump/;  use Test::More tests => 7;
 use Cwd qw/abs_path/;  
7    
8  BEGIN {  BEGIN {
9    use_ok( 'WebPAC::Test' );
10  use_ok( 'WebPAC::Common' );  use_ok( 'WebPAC::Common' );
11  }  }
12    
 my $debug = shift @ARGV;  
   
 ok(my $abs_path = abs_path($0), "abs_path");  
 $abs_path =~ s#/[^/]*$#/#;  
   
13  my $path = "$abs_path/conf/test.yml";  my $path = "$abs_path/conf/test.yml";
14    
15  my $common = 'WebPAC::Common';  my $common = 'WebPAC::Common';
# Line 27  throws_ok { $common->fill_in() } qr/no f Line 20  throws_ok { $common->fill_in() } qr/no f
20  throws_ok { $common->fill_in( '$foo', bar => 42 ) } qr/unknown var/, 'fill_in no variable';  throws_ok { $common->fill_in( '$foo', bar => 42 ) } qr/unknown var/, 'fill_in no variable';
21  cmp_ok( $common->fill_in( 'foo = $foo bar = $bar', foo => 42, bar => 1 ), 'eq', 'foo = 42 bar = 1', 'fill_in' );  cmp_ok( $common->fill_in( 'foo = $foo bar = $bar', foo => 42, bar => 1 ), 'eq', 'foo = 42 bar = 1', 'fill_in' );
22    
23    like $common->var_path( qw/foo bar baz/ ), qr/var.foo.bar.baz/, 'var_path';

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

  ViewVC Help
Powered by ViewVC 1.1.26