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

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

revision 289 by dpavlin, Thu Aug 20 19:00:13 2009 UTC revision 290 by dpavlin, Wed Aug 26 08:43:40 2009 UTC
# Line 4  use warnings; Line 4  use warnings;
4  use strict;  use strict;
5  use autodie;  use autodie;
6    
7  use Test::More tests => 11;  use Test::More tests => 17;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9    
10  use_ok 'file';  use_ok 'file';
# Line 21  ok( file::change( $file, 'test' => 'foob Line 21  ok( file::change( $file, 'test' => 'foob
21  cmp_ok( -s $file, '>', $size, 'size bigger' );  cmp_ok( -s $file, '>', $size, 'size bigger' );
22  ok( ! file::change( $file, 'test' => 'foobar' ), 'change again' );  ok( ! file::change( $file, 'test' => 'foobar' ), 'change again' );
23    
24  ok( file::replace( $file, 'replaced content' ), 'replace' );  ok( file::replace( $file, 'foobar' => 'replaced content' ), 'replace' );
25    
26    my $file2 = $file . '.2';
27    
28    ok( file::copy_once( '/etc/rc.local', $file2 ), 'copy_once' );
29    cmp_ok( -s $file2, '==', -s '/etc/rc.local', 'size' );
30    ok( file::append( $file2, '# foobar' ), 'append to rc.local' );
31    ok( my $content = file::read_file($file2), 'read' );
32    like( $content, qr/foobar.*exit/s, 'foobar before exit' );
33    
34    ok( unlink($file2), 'unlink' );
35    
36  ok( unlink($file), 'unlink' );  ok( unlink($file), 'unlink' );

Legend:
Removed from v.289  
changed lines
  Added in v.290

  ViewVC Help
Powered by ViewVC 1.1.26