mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-07-05 07:44:43 -04:00
Add a "testing mode" inject
Doesn't do anything currently, but will allow for Activities/etc. which can't be easily sub-classed, mocked, etc. during runs to modify behavior.
This commit is contained in:
@ -2,8 +2,7 @@ package org.bspeice.minimalbible;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import org.bspeice.minimalbible.activity.downloader.DownloadActivity;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
@ -24,4 +23,17 @@ public class MinimalBibleModules {
|
||||
Application provideApplication() {
|
||||
return app;
|
||||
}
|
||||
|
||||
/**
|
||||
* This field allows us to set application-wide whether we are in a test or not
|
||||
* Allows components on down the line to know whether they should set some things up or not.
|
||||
* Additionally, not a Singleton so we can enable/disable testing mode as needed. However,
|
||||
* for production, it's always false.
|
||||
* @return Whether we are in a test - false
|
||||
*/
|
||||
@Provides
|
||||
@Named("Testing")
|
||||
boolean isTest() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user