Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opendir doesn't know about mocked directories in a directory. #105

Closed
toddr opened this issue Jan 24, 2022 · 1 comment
Closed

opendir doesn't know about mocked directories in a directory. #105

toddr opened this issue Jan 24, 2022 · 1 comment

Comments

@toddr
Copy link
Member

toddr commented Jan 24, 2022

my @m;
push @m, Test::MockFile->dir('/a/long/path');
push @m, Test::MockFile->dir('/a/long/path/here');
mkdir '/a/long/path';
mkdir '/a/long/path/here';
opendir(my $fh, '/a/long/path');
my @files = readdir $fh;
is(\@files, [qw/. .. here/], "opendir for only dirs dir is right");
not ok 31 - opendir for only dirs dir is right

# Failed test 'opendir for only dirs dir is right'
# at t/opendir.t line 80.
# +------+------------------+-------+
# | PATH | GOT              | CHECK |
# +------+------------------+-------+
# | [2]  | <DOES NOT EXIST> | here  |
# +------+------------------+-------+
@atoomic
Copy link
Contributor

atoomic commented Jan 26, 2022

moved this comment to an isolated case #108

xsawyerx added a commit to xsawyerx/Test-MockFile that referenced this issue Jan 29, 2022
When `opendir()` is run, it creates an object for the directory using
the content of that directory. The `contents()` method did not include
directories in the listing.

Resolves GH cpanel#105.
toddr pushed a commit that referenced this issue Jan 31, 2022
When `opendir()` is run, it creates an object for the directory using
the content of that directory. The `contents()` method did not include
directories in the listing.

Resolves GH #105.
@toddr toddr closed this as completed Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants