Asset-File
view release on metacpan or search on metacpan
is $file->contains('db'), -1, 'does not contain "db"';
is $file->size, 3, 'right size';
is $file->mtime, (stat $file->handle)[9], 'right mtime';
# Cleanup
my $path = $file->path;
ok -e $path, 'temporary file exists';
undef $file;
ok !-e $path, 'temporary file has been cleaned up';
# Open existing and upgrade to rw
Asset::File->new({path => $path, cleanup => 0})->add_chunk('foo');
my $stat = [(stat($path))];
$file = Asset::File->new(path => $path);
is_deeply [(stat($path))], $stat, "opening didn't affect stat";
ok eval { $file->add_chunk('bar') }, "didn't die";
is $file->get_chunk, 'foobar', 'right content';
undef $file;
ok -e $path, 'file exists';
unlink $path;
# Empty file asset
$file = Asset::File->new;
is $file->contains('a'), -1, 'does not contain "a"';
# File asset range support (a[bcdefabc])
$file = Asset::File->new();
( run in 1.249 second using v1.01-cache-2.11-cpan-49f99fa48dc )