-
Notifications
You must be signed in to change notification settings - Fork 41
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
can't run spec objects when the object is a companion of a trait #466
Comments
@hmemcpy if u give me an initial direction I may be able to come up with a PR for this |
Thanks for reporting! Sorry, I'm just now getting around to looking at those issues. Thanks again! |
Hmm.. this is an interesting issue, but I'm not so sure it can be solved. The problem is with how Scala generates the corresponding .java/.class files. Since Java doesn't really have static objects, by default, when you compile an The By default, when you have just the object, the generated Since the test runner tries to load the class with reflection, eventually, it fails to find the class instance for Other than blocking such attempts in the UI I'm not sure if it's possible to fix this. I'll sleep on this and see if I can come up with a better solution. BTW, you could use |
thanks @hmemcpy for looking into this! and even better for the deep investigation + explanation. I think it'd be nice to see what scalaTest does in this scenario, perhaps someone already solved this issue? |
we use a pattern of writing our test suits as objects (best practice I guess) which works fine.
however sometimes we also define an empty trait with the same name just so we can get access to its slf4j logger using the class name (the companion has a trailing
$
):The plugin does recognize the object as a test suit (adds the 'play' buttons on the object and tests), however when attempting to run the suite, we get this failure:
Run Configuration Error: Class 'com.datorama.pluto.sql.JdbcDirectZTest' is not inheritor of Suite trait
The text was updated successfully, but these errors were encountered: