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

add File#exists? #519

Merged
merged 1 commit into from
May 12, 2015
Merged

add File#exists? #519

merged 1 commit into from
May 12, 2015

Conversation

jhoblitt
Copy link
Contributor

When doing negative testing, I.e., asserting that 'this' path should not exist, it would be more concise to be able to express this in serverspec as:

describe File('/does_not_exist') do
  it { should_not exist }
end

@jhoblitt
Copy link
Contributor Author

Depends on mizzy/specinfra#384

@mizzy
Copy link
Owner

mizzy commented May 12, 2015

You should test file resource strictly with be_file, be_directory, be_socket and so on. exists? is a bit ambiguous. So I will not add exists? to file resource.

@jhoblitt
Copy link
Contributor Author

@mizzy What is the correct way to test for the non-existence of a file?

@mizzy
Copy link
Owner

mizzy commented May 12, 2015

@jhoblitt Ah, I see what you would like to do with this PR. Please write your aim of the PR in the description field.

@jhoblitt
Copy link
Contributor Author

@mizzy I thought it was just a simple oversight since many of the other base types respond to exists?. I've added a description to the PR, please let me know if that is sufficient A negative test isn't included because the test harness is hard-wired to have all the [specinfra] checks pass.

@mizzy
Copy link
Owner

mizzy commented May 12, 2015

Thanks for updating the description! It's sufficient.
Please do not mind about test. I understand it.

mizzy added a commit that referenced this pull request May 12, 2015
@mizzy mizzy merged commit b2ac432 into mizzy:master May 12, 2015
@mizzy
Copy link
Owner

mizzy commented May 12, 2015

Released as v2.17.0.

@jhoblitt
Copy link
Contributor Author

@mizzy Thanks!

@conorsch
Copy link

@jhoblitt Thanks for this! It's frustrated me in the past, too.

@jhoblitt
Copy link
Contributor Author

@conorsch your welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants