I have some Test which I would like to run with Robolectric, I use the 2.3-SNAPSHOT as my APP uses the ActionbarCompat i needed to use 2.3-SNAPSHOT Version as Robolectric co
Update: The annotation is now @Config(sdk = 18)
(or @Config(sdk = Build.VERSION_CODES.JELLY_BEAN_MR2)
) and the properties file mentioned in link is now robolectric.properties
.
Original Answer:
You can use the @Config
annotation to have Robolectric emulate an SDK version. You can put this :
import org.robolectric.annotation.Config;
@Config(emulateSdk = 18) // now @Config(sdk = 18) as of Robolectric 3.0
@RunWith(RobolectricTestRunner.class)
public class SomeTest ...
This is also possible using a file as mentioned here
Not sure what it means for your KitKat specific tests but at least the others should work.