r1650@llin: dpavlin | 2007-11-20 11:07:57 +0100
[webpac2] / t / 0-common.t
index d21e2aa..da4f399 100755 (executable)
@@ -1,22 +1,15 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 6;
-use Test::Exception;
 use blib;
 
-use Data::Dump qw/dump/;
-use Cwd qw/abs_path/;
+use Test::More tests => 7;
 
 BEGIN {
+use_ok( 'WebPAC::Test' );
 use_ok( 'WebPAC::Common' );
 }
 
-my $debug = shift @ARGV;
-
-ok(my $abs_path = abs_path($0), "abs_path");
-$abs_path =~ s#/[^/]*$#/#;
-
 my $path = "$abs_path/conf/test.yml";
 
 my $common = 'WebPAC::Common';
@@ -27,3 +20,4 @@ throws_ok { $common->fill_in() } qr/no format/, 'fill_in without format';
 throws_ok { $common->fill_in( '$foo', bar => 42 ) } qr/unknown var/, 'fill_in no variable';
 cmp_ok( $common->fill_in( 'foo = $foo bar = $bar', foo => 42, bar => 1 ), 'eq', 'foo = 42 bar = 1', 'fill_in' );
 
+like $common->var_path( qw/foo bar baz/ ), qr/var.foo.bar.baz/, 'var_path';