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

Make the default factory a little more lenient #171

Closed
pdvrieze opened this issue Jan 26, 2017 · 1 comment
Closed

Make the default factory a little more lenient #171

pdvrieze opened this issue Jan 26, 2017 · 1 comment
Milestone

Comments

@pdvrieze
Copy link

Currently the default factory (in SpekTestEngine) assumes that the spek has a primary constructor that is a no-arg constructor. This can be replaced by: spek.objectInstance ?: spek.constructors.first { it.parameters.isEmpty }.call() to allow for secondary constructors.

My use case is that I want to be able to use the case standalone and included in another spek. When included I want to reduce the amount of test cases it generates (by default 6327 tests - mostly on different data) such as to reduce test time (btw. it seems that test execution has quite a number of bottlenecks).

@raniejade
Copy link
Member

Currently the default factory (in SpekTestEngine) assumes that the spek has a primary constructor that is a no-arg constructor. This can be replaced by: spek.objectInstance ?: spek.constructors.first { it.parameters.isEmpty }.call() to allow for secondary constructors.

👍

My use case is that I want to be able to use the case standalone and included in another spek. When included I want to reduce the amount of test cases it generates (by default 6327 tests - mostly on different data) such as to reduce test time (btw. it seems that test execution has quite a number of bottlenecks).

Would be nice if you could describe those bottlenecks in another ticket? :)

@raniejade raniejade added this to the 1.1 milestone Jan 29, 2017
raniejade added a commit that referenced this issue Jan 29, 2017
Resolves #171, no-arg secondary constructors will
now also be considered. If you have multiple no-arg
constructors, behaviour is undefined.
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