On Mon, Feb 24, 2003 at 03:52:29PM +0000, Mark Fowler wrote:
> For a module I'm doing at work, I want to check that the correct files
> have been written (and no extra files have been written) in a directory.
> 
> Other than writing lots of is(-e based code, is there a simple way to do
> this?  I had a look at File::CheckTree, but it didn't look like the kind
> of thing to use alongside Test::Builder.
> 
> Suggestions?

File::CheckTree is bizarre.

sub ls {
    opendir my $dir, shift;
    return grep !/^\.{1,2}$/, readdir $dir;
}

write_some_files('some_dir');
is_deeply([ls("some_dir")], [qw(files expected to be there)]);

Reply via email to