/[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

Annotation of /trunk/t/0-common.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 856 - (hide annotations)
Sun May 27 16:00:26 2007 UTC (16 years, 11 months ago) by dpavlin
File MIME type: application/x-troff
File size: 698 byte(s)
added fill_in to create dynamic values and some tests

1 dpavlin 856 #!/usr/bin/perl -w
2    
3     use strict;
4     use Test::More tests => 6;
5     use Test::Exception;
6     use blib;
7    
8     use Data::Dump qw/dump/;
9     use Cwd qw/abs_path/;
10    
11     BEGIN {
12     use_ok( 'WebPAC::Common' );
13     }
14    
15     my $debug = shift @ARGV;
16    
17     ok(my $abs_path = abs_path($0), "abs_path");
18     $abs_path =~ s#/[^/]*$#/#;
19    
20     my $path = "$abs_path/conf/test.yml";
21    
22     my $common = 'WebPAC::Common';
23    
24     cmp_ok( $common->fmt_time( 123456 ), 'eq', '10h17:36', 'fmt_time' );
25    
26     throws_ok { $common->fill_in() } qr/no format/, 'fill_in without format';
27     throws_ok { $common->fill_in( '$foo', bar => 42 ) } qr/unknown var/, 'fill_in no variable';
28     cmp_ok( $common->fill_in( 'foo = $foo bar = $bar', foo => 42, bar => 1 ), 'eq', 'foo = 42 bar = 1', 'fill_in' );
29    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26