-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Make sure a file/directory does not exist + Cleanup named file/directory steps #234
Conversation
Mmh... Seems like there are some more inconsistencies in step names:
@jarl-dk What do you think which wording should be used? I don't think we should support both ones. |
Actually, I'd love it if we did. I keep forgetting the 'named' bit when I use these steps in Cucumber's features, and I've always thought it read awkwardly. What about making it consistently optional? |
Me too
What do you mean with "consistently optional"? |
Something like this:
|
ah. ok. I see. will fix that. |
Ok. I changed some tests to test the new behaviour. Now all steps for directories/files are built like that. I also change the "not"-thing as well to reduce the number of needed steps - a pattern I found in other existing steps. Then /^(?:a|the) file(?: named)? "([^"]*)" should (not )? exist$/ do |file, expect_match|
check_file_presence([file], !expect_match)
end |
If you prefer I can split up this PR and make a new one for the newly added steps. Although those steps were the reason I opened this PR. 😄 |
ok? |
LGTM. It might be worth rebasing your commits to keep the history tidy when we merge this in. |
Rebased. |
@mattwynne @jarl-dk Can we go on with this PR? |
Rebased. |
Make sure a file/directory does not exist + Cleanup named file/directory steps
I often use an
init
-command to create some files. In my steps I try to make it obvious that the file should not exist. This PR adds new cucumber steps which makes the intent very clear and does not fail if I file/directory does not exist. This PR also includes a small refactoring - hope this is ok.New steps
Cleanup step
I'm very well aware of the
I remove file/directory "xz.txt"
-step. But I think the intention is very different.