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

The append_to_file method should provide feedback if file does not exist #726

Closed
luke-hill opened this issue Aug 21, 2020 · 3 comments · Fixed by #829
Closed

The append_to_file method should provide feedback if file does not exist #726

luke-hill opened this issue Aug 21, 2020 · 3 comments · Fixed by #829
Assignees
Labels
Milestone

Comments

@luke-hill
Copy link
Contributor

Summary

When using When I append to file "...." with: one of the following should happen if the file doesn't exist.

  • A warning should be thrown
  • An error should be thrown

Current Behavior

It silently does nothing

Possible Solution

Steps to Reproduce (for bugs)

Self explanatory

Context & Motivation

Was fixing some stuff in cucumber-rails. Found this issue when writing some new features.

@luke-hill luke-hill added the bug label Aug 21, 2020
@mvz mvz self-assigned this Aug 21, 2020
@mvz mvz modified the milestones: 1.2.0, 1.1.0 Aug 21, 2020
@mvz
Copy link
Contributor

mvz commented Jan 24, 2021

It silently does nothing

What do you mean by this? From the code, it seems it silently creates the file. Is that the behavior you're seeing?

@mvz mvz changed the title Aruba helper - append_to_file issue The append_to_file method should provide feedback if file thus not exist Jan 24, 2021
@mvz mvz changed the title The append_to_file method should provide feedback if file thus not exist The append_to_file method should provide feedback if file does not exist Jan 24, 2021
@mvz
Copy link
Contributor

mvz commented Jan 24, 2021

This is officially documented bad behavior:

Scenario: Append to a non-existing file
Given a file named "features/non-existence.feature" with:
"""
Feature: Existence
Scenario: Existence
Given a file named "foo/bar/example.txt" does not exist
When I append to "foo/bar/example.txt" with:
\"\"\"
this was appended
\"\"\"
Then the file named "foo/bar/example.txt" should contain:
\"\"\"
this was appended
\"\"\"
"""

Steps to resolve this:

  • In 1.x: Deprecate silent creation of the file
  • In 2.0: Remove silent creation of the file

@luke-hill
Copy link
Contributor Author

Sounds perfect. Good solution, definite thumbs up from me.

@mvz mvz modified the milestones: 1.1.0, 2.0.0 Jun 20, 2021
@mvz mvz closed this as completed in #829 Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants