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

Cop Idea: prevent "it works" description #1337

Closed
BigBigDoudou opened this issue Jul 27, 2022 · 4 comments
Closed

Cop Idea: prevent "it works" description #1337

BigBigDoudou opened this issue Jul 27, 2022 · 4 comments

Comments

@BigBigDoudou
Copy link

I see too many this:

it "works" do
  # ...
end

Specs are not just here to prevent bugs, but are, as the name implies, specifications. In other words, a documentation we can use as developer to understand what the code is supposed to do.

So it could be nice to enforce a description of "what it does". Preventing "it works" would be a good start 😋

# bad

it "works" do
  # ...
end

# good

it "marks the task as done" do
  # ...
end
@pirj
Copy link
Member

pirj commented Jul 27, 2022

Sounds great. Would you like to open a PR with such a cop? It should be an easy one. There's RSpec/ContextDescription for the reference.

@pirj pirj added the cop label Jul 27, 2022
@Darhazer
Copy link
Member

It can have a configuration for disallowed patterns

@BigBigDoudou
Copy link
Author

Sounds great. Would you like to open a PR with such a cop? It should be an easy one. There's RSpec/ContextDescription for the reference.

That would be my first cop but there's no rush so yeah I can do it someday.

@akrox58
Copy link

akrox58 commented Aug 3, 2022

took a stab at this cop requirement! happy to make any changes!

akrox58 added a commit to akrox58/rubocop-rspec that referenced this issue Aug 4, 2022
akrox58 added a commit to akrox58/rubocop-rspec that referenced this issue Aug 4, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 4, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 4, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 5, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 5, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 5, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 6, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 7, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 7, 2022
akrox58 pushed a commit to akrox58/rubocop-rspec that referenced this issue Aug 9, 2022
pirj pushed a commit to akrox58/rubocop-rspec that referenced this issue Oct 10, 2022
pirj pushed a commit to akrox58/rubocop-rspec that referenced this issue Oct 10, 2022
pirj pushed a commit to akrox58/rubocop-rspec that referenced this issue Oct 10, 2022
pirj pushed a commit to akrox58/rubocop-rspec that referenced this issue Oct 13, 2022
pirj pushed a commit to akrox58/rubocop-rspec that referenced this issue Oct 13, 2022
@pirj pirj closed this as completed in 31c1dd7 Oct 13, 2022
pirj added a commit that referenced this issue Oct 13, 2022
…_cop_to_call_out_insufficient_descriptions

[Fix #1337] Update the cop to raise error for insufficient descriptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants