-
Notifications
You must be signed in to change notification settings - Fork 55
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
Rewrite lightcycle-processor test #67
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.
This looks like a good change to me. It's a bit narly as you said, messing with strings, but honestly I think the benefit of being ability to debug it properly in the IDE trumps that verbosity. 👍
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 agree.
It is an improvement. I like that the expected code is next to the test code.
|
||
/** | ||
* Created by yuwono-niko on 11/9/16. | ||
*/ |
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.
Please, no headers
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.
Sorry, will remove them all
|
||
@Test | ||
public void shouldGenerateInjectorForActivity() { | ||
JavaFileObject validTestActivity = forSourceString("com/test/ValidTestActivity", VALID_TEST_ACTIVITY); |
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.
What do you think about inlining these constants too ?
By doing so, we have the source and the expected generated source sitting together.
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 was thinking about inlining them too, but since the original code use constants I thought it'll be better to follow the existing code style.
But yes I agree with you, it'll look better if these constants are inlined. Will change it.
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.
Thx !
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.
Done! Let me know if you have other feedback :)
great ! I try to release asap and I'll give you a heads up. What is you twitter handle ? |
@niko_yuwono ! Thank you very much! Will do the checkstyle this weekend :) |
This is a proposal to use different approach to write test classes.
In #64 we talked about lightcycle-processor test can't be run directly from IDE, and after I checked lightcycle-processor test source code, looks like for now Android Studio can't find the file from resources directory.
In this pull request I rewrote the approach from getting the file from resource directory to write the java source file as a String directly in the test classes.
After thinking and rewriting about this approach this is my conclusion
Pros :
Cons :
Note :
org.truth0.Truth.ASSERT.about
intocom.google.common.truth.Truth.assertAbout
becauseorg.truth0.Truth
class is deprecated