/[pxelator]/lib/PXElator/t/client.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 /lib/PXElator/t/client.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 156 - (hide annotations)
Thu Aug 6 15:15:53 2009 UTC (14 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 671 byte(s)
implement client::conf to fetch/set (with default) client configuration

1 dpavlin 156 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5     use autodie;
6    
7     use Test::More tests => 7;
8     use Data::Dump qw/dump/;
9    
10     use_ok 'client';
11    
12     my $host = '127.0.0.1';
13     my $test_path = "$server::base_dir/conf/$server::ip/ip/$host/test";
14     unlink $test_path if -e $test_path;
15    
16     ok( client::conf( $host => 'test', default => 'default' ), 'conf default' );
17     cmp_ok( client::conf( $host => 'test' ), 'eq', 'default', 'default' );
18     ok( client::conf( $host => 'test' => 'value' ), 'conf set' );
19     cmp_ok( client::conf( $host => 'test' ), 'eq', 'value', 'value' );
20    
21     diag "cleanup";
22     ok( unlink($test_path), "unlink $test_path" );
23     $test_path =~ s{/[^/]+$}{};
24     ok( rmdir($test_path), "rmdir $test_path" );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26