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.
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"() {
given:
def textView = new TextView(RuntimeEnvironment.application)
expect:
textView.text == "Hello"
}
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 {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'
}
}
apply plugin: 'com.android.application'
apply plugin: 'groovyx.grooid.groovy-android'
repositories {
mavenCentral()
}
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.
If you don't know how to test a code framgent please - we'll be happy to help.