B.9. Spock Android extension

Android Java is not 100% compatible with desktop Java. Vanilla Spock can’t run unmodified on Android because the mocking libraries it uses don’t work on Android.

The Spock Android extension (https://github.com/pieces029/android-spock) not only fixes this problem but also allows you to inject Android objects (such as activities) in your Spock tests. Here’s an example taken from the extension website.

Listing B.9. Using Spock with Android

The code can be found in Maven Central and is easy to use in your own Java project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.194.123