Skip to content
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

Tests use classes instead of objects #9

Merged
merged 1 commit into from Nov 13, 2018

Conversation

npryce
Copy link
Collaborator

@npryce npryce commented Nov 8, 2018

JUnit 5 uses reflectomagic to instantiate test classes, which means that
it instantiates multiple instances of an object's class, violating its
singleton-ness. Therefore it's safer to define tests in classes.

@dmcg
Copy link
Owner

dmcg commented Nov 12, 2018

I'd like the change, could you just bring it up to date on your fork?

JUnit 5 does some reflectomagic to violate Java visibility rules when
instantiating test classes, and so breaks the singleton-ness of
Kotlin objects.
@npryce npryce force-pushed the tests-use-classes-instead-of-objects branch from 6ba7ca0 to 67a74bb Compare November 13, 2018 13:12
@npryce
Copy link
Collaborator Author

npryce commented Nov 13, 2018

Done.

@dmcg dmcg merged commit 826d59a into dmcg:master Nov 13, 2018
@npryce npryce deleted the tests-use-classes-instead-of-objects branch November 13, 2018 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants