rubocop-rspec
rubocop-rspec copied to clipboard
Cop Idea: prevent "it works" description
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
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.
It can have a configuration for disallowed patterns
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.
took a stab at this cop requirement! happy to make any changes!