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

Test fails in Spek Android Studio plugin but works in Gradle due to different classpath #975

Open
nathan815 opened this issue Jul 11, 2021 · 3 comments

Comments

@nathan815
Copy link

nathan815 commented Jul 11, 2021

I have a Spek test running successfully with ./gradlew test, but it fails when running with the Spek Framework Android Studio plugin. For some reason the Spek plugin isn't picking up my override of android.util.Log (in src/test/java/android/util) so the default Log stub class is being loaded instead.

Stub!
java.lang.RuntimeException: Stub!
	at android.util.Log.i(Log.java:33)
...

Is there a way to get the plugin to use the same classpath as tests run through ./gradlew test?

@raniejade
Copy link
Member

Hey @nathan815, what AS and spek plugin version are you using? It might be that you pulled in the plugin for IJ not for AS. For AS 4.2 you have to use https://plugins.jetbrains.com/plugin/10915-spek-framework/versions/dev/126685 for now.

@nathan815
Copy link
Author

Hey @raniejade, here are my versions:

AS: 4.2.2
Spek plugin: 2.0.16-IJ2020.2

So I did have the IntelliJ version. The one you sent works well - thank you!

@nathan815
Copy link
Author

Is it possible to download the AS version of the plugin directly through AS plugin marketplace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants