-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
"Use described_class" when not possible #59
Comments
I ran into same issue, here is my code: RSpec.describe MyModule do
controller(ApplicationController) do
include MyModule # rubocop:disable RSpec/DescribedClass
def index
my_module_method
render text: 'Hello World'
end
end
|
When you provide a constant to So IMO passing a module is incorrect, and this should be written in an different way, e.g. |
I'm looking into fixing this. Basically, the issue here is blocks which are executed using
I am leaning towards the second because I think Does anyone have any better ideas? |
cc @pavlo-vavruk @madwort and @mknapik on the comment above ^. I assume the 👍s mean you also want your use cases fixed |
Another option would be to add an |
I've released 1.6.0 with a |
Hi @backus yes, the 👍 was because I'd also experienced the auto-correction changing valid code to invalid code in this way. I've just tested 1.6.0 and can confirm that the cop now ignores the relevant bit of code in our project. Thanks for your efforts! |
Reports this offense:
Use described_class instead of MyConcern
But
described_class
is not defined inside the block, so I can't use it.The text was updated successfully, but these errors were encountered: