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

How to do a single test? #410

Closed
paul-hammant opened this issue May 13, 2018 · 3 comments
Closed

How to do a single test? #410

paul-hammant opened this issue May 13, 2018 · 3 comments

Comments

@paul-hammant
Copy link

Other frameworks allow you to prefix with only().it(...) or only().describe(...)

How does that work in Spek ?

@lewismorgan
Copy link

Do you mean running just a single test? You can group your tests in "describe", "on", and "it". Each one can be run by itself without running all the tests in the class, unless it's the parent of the test from my understanding. There is gutter icons in the IntelliJ IDE that you can use to run if you're using the plugin. Looks like the IDE runs a spek tooling class. Here's a cutdown version of the console output.

org.jetbrains.spek.tooling.MainKt --spec com.mydomain.TestingSpek --path "path2speklambda"

Like I said, I recommended looking at that class to see how it works and to know exactly what Path is expecting using the plugin. I'm not sure if there is one for running without the plugin or not.

@paul-hammant
Copy link
Author

If I'm in Intellij, I presume I can customer the test-runner to pass those --spec and --path options to the executer. If from Maven, it'd be -Dpath=path2speklambda, right?

I'm asking because I have hundreds of nested describes, and its, and for experimental purposes I'm wanting to run just one without commenting out others, or rearranging the source significantly to facilitate my temporary need.

Same thought from a different angle here - raniejade/spek-idea-plugin#66

@raniejade
Copy link
Member

raniejade commented May 18, 2018

We have f prefixed versions of the scopes (fit, fdescribe, etc...) which is the same as only()., but was dropped in 1.1. We felt it was a hacky solution for frameworks who don't have any good IDE support.

Closing this as it is a duplicate of #285 .

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

3 participants