我的單元測試和我的android應用程序住在單獨的項目中。如何在Robolectric 2.2中指定自定義/ res目錄?
隨着Robolectric 1,我可以像這樣指定我/ res目錄位置:
public class MyTestRunner extends RobolectricTestRunner {
public MyTestRunner(Class<?> testClass) throws InitializationError {
super(testClass, "../app/AndroidManifest.xml", "../app/res");
}
}
如何在Robolectric 2.2指定/ res目錄的位置?
由於Robolectric 2.x中,使用[@Config](http://robolectric.blogspot.com/2013/05/configuring-robolectric-20.html)註釋來代替。 – Xian
@Xian是否'@ Config'用'gradle'構建工作,當測試住在'的src /測試/ java'?還是需要'RobolectricGradleTestRunner'? –
我不清楚爲什麼'gradle'世界如此不同;抱歉,不確定。 – Xian