-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Old specs need love #8127
Comments
Some of these are much easier to convert than others. Most of the tests are as easy as merging an inspect test with and autocorrect test and rewriting a couple of lines. The tests that make use of |
Like which one? We introduced |
Interesting, I didn't know |
Use newer `expect_offense + expect_correction` instead of the older `inspect_source + autocorrect_source`. Part of rubocop#8127
@marcandre I am willing to take some of this refactoring work. What would you prefer of the following?
Or anything else? |
Either work, I'd say group them as you like. |
Use newer `expect_offense + expect_correction` instead of the older `inspect_source + autocorrect_source`. Part of #8127
Use newer expect_offense + expect_correction Expect production offense instead of formatting message in the spec Part of rubocop#8127
Some new syntax of use here:
|
I'm planning to pick up some more of these this weekend, to pick up the ones I missed in the |
Hi all! |
I'm picking up the rest of the |
I ran into a problem while I was working on the task. I can't understand how to implement To throw an error I've written a wrong spec
The error was
So if I'll write Have anybody already met the problem? Is there a solution or do we have to enhance parser? |
@AndreiEres Good point. You are right, I don't think there's a way around this one. We could add some functionality to |
I have a solution for it, but life happened and didn't create a PR with it yet.
But @marcandre is right in that it's a very rare case - so I was hesitant wether this matcher is worth adding or not. |
If you have something that works @mechos3d, we can definitely include it. |
So I've used error raising in #9263 because that is built-in and needn't additional helpers. Thus we've completed with using |
Could you tell me, please? What can we do with old syntax in that files? |
|
I don't see an issue. If the failure message is different,
I don't see an issue, the two cases should be combined and Or am I missing something? |
I mean if there are no issues could we close the issue? |
There are still 4 uses of |
I'll tackle these last ones if no objections, I think they should pretty reasonable to finish off. Sorry I've been absent from this for a long while, life happened.
|
This is amazing that we finally get to close this out! This spec conversion has been years in the making. Great job everyone that helped out! |
Many cop specs still use
inspect_source
orautocorrect_source
. We'll like to deprecated this (see #8003), so they should be refactored to useexpect_offense
+expect_correction
instead (I'd love to have an even nicer API for this).The text was updated successfully, but these errors were encountered: