RoboSpock tests are executed on the JVM. That means no DEXing or deployment time is wasted to execute your unit tests.


RoboSpock glues several frameworks together and enables you to work with them directly.

Batteries included

Enjoy the support for Spock framework, Groovy language and RoboGuice


RoboSpock combines two great test frameworks and lets you get the best of both - to run fast unit test written with Groovy on local JVM.

It integrates well with Gradle build system and works with older Ant based projects.

def "should display hello text"() {
    def textView = new TextView(RuntimeEnvironment.application)

    textView.text == "Hello"

Thanks to RoboSpock you can

  • Unit test Android code with Spock and Groovy
  • Write readable specifications
  • Execute tests fast on JVM
  • Mock your objects and test interactions
  • Specify behavior of Android SDK classes
  • Modify runtime dependencies configured with RoboGuice


For every build tools Android projects has it's clashes with IDE support. We've done our best to show you how to integrate your whole environment for both Ant and Gradle (New Build System).

buildscript {
    repositories {
    dependencies {
        classpath ''
        classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'

apply plugin: ''
apply plugin: 'groovyx.grooid.groovy-android'

repositories {

dependencies {
    testCompile 'org.robospock:robospock:1.0.0'


This section provides useful examples for integrating unit tests into diversed Android projects.


Soon you will wind here sample project with Dagger DI integration.

Need more?

If you don't know how to test a code framgent please let us know - we'll be happy to help.

Fork me on GitHub