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

Library as trait(s) instead of inheritance class #55

Open
hotmeteor opened this issue May 22, 2020 · 3 comments
Open

Library as trait(s) instead of inheritance class #55

hotmeteor opened this issue May 22, 2020 · 3 comments

Comments

@hotmeteor
Copy link

It would be awesome if these tools were provided as traits rather than a class to extend. We have an existing extended TestCase, so I can't use this out of the box and will need to roll my own trait.

Obviously not a big deal, just a suggestion.

@byjg
Copy link
Owner

byjg commented May 22, 2020

Excellent theme you bring here. Well, my first idea was to create a trait, however the code depends on the the assertTrue existing in the TestCase class. It is strange have a code not contained itself. So it is open to discussion and pointing alternatives.

@hotmeteor
Copy link
Author

It could be based on an interface that is added to a TestCase class that requires implementation of the trait methods AND assertTrue. Then all requirements are enforced. It’s at least more flexible than an inheritance class.

@byjg
Copy link
Owner

byjg commented May 23, 2020

Could you give an example?

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

No branches or pull requests

2 participants