rubocop / rspec-style-guide

Best practices for writing your specs!
http://rspec.rubystyle.guide
958 stars 118 forks source link

Is there a cop that will enforce `.to eq`? #125

Closed schinery closed 2 years ago

schinery commented 2 years ago

Is there is a cop that can enforce the style of .to as sometimes getting mixed examples in our codebase, for example .to(eq) and .to eq, so wondering if there is anything that can enforce:

# Good
expect(element.name).to eq("Country")

# Also good (maybe?)
expect(element.name).to eq "Country"

# Bad
expect(element.name).to(eq("Country"))

I've been looking through the RSpec cops and can't see anything, so suspect not, but wondering if this would be useful?

schinery commented 2 years ago

Closing as should have posted to https://github.com/rubocop/rubocop-rspec