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

Allow test to be an unparenthesized method #410

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

reese
Copy link
Collaborator

@reese reese commented Feb 12, 2023

Closes #383

test works just like it and describe in Rails tests, so I think it's fine to let it not use parens just like the other test methods.

@fables-tales
Copy link
Owner

what if we just did a sin and forced all these methods to be parenthesized?

@bibstha
Copy link
Contributor

bibstha commented Feb 25, 2023

Would love to see it get merged.

what if we just did a sin and forced all these methods to be parenthesized?

@fables-tales Rails and a bunch of ruby test frameworks use these without () today. It makes it readable, plus that is the accepted norm. Sometimes the rails test runner doesn't pickup the line-numbering when defined with test("my test case") do; end when running a single test case.

@pjg
Copy link

pjg commented Dec 10, 2023

Could we add context to this list as well? It's so weird seeing rubyfmt adding braces to all my context 'xxx' do methods, while leaving it and describe without them.

@pjg
Copy link

pjg commented Dec 10, 2023

And similarly all other RSpec "helper" methods should also be left without parenthesis: to, not_to, to_not, be, eql, include and so on.

Observing expect(country).to eql 'Ukraine' be transformed into expect(country).to(eql('Ukraine')) is just not great as the existing convention, which I believe to be the norm, is to omit parentheses in such situations.

I wish this was configurable in some way for the end user, though I understand the goal of the project being configuration-less.

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.

Add test to the list of methods that do not get parentheses
4 participants