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

Fix directory resource output and exists check #1950

Merged
merged 2 commits into from
Jun 23, 2017

Conversation

adamleff
Copy link
Contributor

@adamleff adamleff commented Jun 22, 2017

The to_s method on the directory resource is not defined in the correct class, leading directory resources to be printed as the parent resource (file) instead.

Also, the exist? method just reuses the file resource's exist? method which can lead to perceived false results when a user calls it {should exist} on a file with the directory method thinking it's actually checking to see if the target is a directory as well. This change ensures that the exist? method also checks to make sure the target is a directory.

Fixes #1944

@adamleff adamleff added in progress Type: Bug Feature not working as expected labels Jun 22, 2017
The `to_s` method on the `directory` resource is not defined
in the correct class, leading `directory` resources to be printed
as the parent resource (`file`) instead.

Signed-off-by: Adam Leff <adam@leff.co>
Signed-off-by: Adam Leff <adam@leff.co>
@adamleff adamleff force-pushed the adamleff/fix-directory-output branch from b5e0124 to 271d2ef Compare June 23, 2017 11:38
@adamleff adamleff changed the title Fix to_s on directory resource Fix directory resource output and exists check Jun 23, 2017
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @adamleff

@chris-rock chris-rock merged commit b4f7725 into master Jun 23, 2017
@chris-rock chris-rock deleted the adamleff/fix-directory-output branch June 23, 2017 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants