Skip to content

Substitute quotes with underscores for method name #1955

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

Merged
merged 4 commits into from
Feb 16, 2018
Merged

Substitute quotes with underscores for method name #1955

merged 4 commits into from
Feb 16, 2018

Conversation

shanecav84
Copy link
Contributor

Rails' SystemTestCase uses method_name to generate a filename for a screenshot, which is output along with the failure message. The filename for examples with single or double quotation marks retain the marks, making it tedious to copy-and-past the generated filename then manually escape it to use in a shell command.

Rails' SystemTestCase uses `method_name` to generate a filename for a screenshot, which is output along with the failure message. The filename for examples with single or double quotation marks retain the marks, making it tedious to copy-and-past the generated filename then manually escape it to use in a shell command.
Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

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

I'm happy to improve this, but I'd really like a spec covering this scenario, otherwise we might simplify it in future without realising.

@shanecav84
Copy link
Contributor Author

shanecav84 commented Feb 13, 2018 via email

@shanecav84
Copy link
Contributor Author

What do you think about just replacing the regex with /[^0-9A-Za-z]/?

@JonRowe
Copy link
Member

JonRowe commented Feb 14, 2018

I'd rather we only remove characters that would otherwise cause problems.

@shanecav84
Copy link
Contributor Author

Spec is up. I changed the gsub to a tr and extracted a constant. The tests seem to be failing for reasons unrelated to this PR.

@JonRowe
Copy link
Member

JonRowe commented Feb 16, 2018

Thanks, I've kicked the build to see if it'll go green and will assess it if it fails again.

@JonRowe JonRowe merged commit c798777 into rspec:master Feb 16, 2018
JonRowe added a commit that referenced this pull request Feb 16, 2018
JonRowe added a commit that referenced this pull request Feb 16, 2018
Substitute quotes with underscores for method name
JonRowe added a commit that referenced this pull request Feb 16, 2018
@JonRowe
Copy link
Member

JonRowe commented Feb 16, 2018

Merged, thanks

@shanecav84 shanecav84 deleted the patch-1 branch February 16, 2018 16:36
benoittgt pushed a commit to benoittgt/rspec-rails that referenced this pull request Mar 4, 2018
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants