-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Annotate private to spec methods/classes more #3892
Annotate private to spec methods/classes more #3892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the cleanup are fine, but I made I comment regarding the changed requires. Thanks!
@@ -1,26 +1,24 @@ | |||
require "spec" | |||
require "yaml" | |||
require "../../../../src/compiler/crystal/**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using relative paths allow testing the code of the compiler without building the compiler.
if we keep the require "compiler/crystal/**" the code that will be tested is the one in the compiler used to build the specs.
I would leave the require "../../.. ...." since it allows more unit test like of the compiler.
Checking in the code, I notice that it could be replaced with require "../../spec_helper"
But maybe that could be handle in another PR and just leave this for enforcing the private
methods/classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that's incorrect. The bin/crystal
wrapper should edit the load path so that any part of the stdlib is loaded from the git repo, not the distribution. There's nothing special about the compiler requires.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RX14 My comment applies when you do $ crystal spec spec/compiler/.../
. i.e. no bin/crystal
wrapper is called.
At least for a DRY about relative vs crystal path we should change this to require spec_helper. But again that is not about adding private to methods and classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bcardiff as far as i'm concerned we shouldn't be supporting not using bin/crystal
. All the specs for the stdlib use non-relative requires, so I don't see why the compiler should be special.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RX14 you are probably right and things might be as they are because of evolution only and could be changed. There is no point in using bundled stdlib with compiler with current master code.
|
f88a3a6
to
1072871
Compare
1072871
to
eb9ca88
Compare
@asterite Ok. I updated to use |
Thanks @makenowjust . I think there where some tools specs you cleaned up removing whitespaces. I see those changes gone now. I miss why they where changed in the first place, maybe that will come up later, but if you have those change around, may I ask you the reason for those changes? |
Crystal supports file
private
methods and classes. This pull request applyprivate
annotation to methods or classes in spec files.