Make sure the unit tests pass correctly

This commit is contained in:
Bradlee Speice 2014-09-12 22:36:53 -04:00
parent cbb4b5fd14
commit 67b11b3ab0
3 changed files with 8 additions and 5 deletions

View File

@ -86,5 +86,7 @@ dependencies {
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:+'
// Email debug reports if I crash...
testConfigCompile 'ch.acra:acra:+'
testConfigCompile('ch.acra:acra:+') {
exclude module: 'json'
}
}

View File

@ -4,7 +4,7 @@ import android.test.ActivityInstrumentationTestCase2;
import org.bspeice.minimalbible.Modules;
import org.bspeice.minimalbible.activity.viewer.BibleViewer;
import org.bspeice.minimalbible.activity.viewer.BookManager;
import org.bspeice.minimalbible.service.manager.BookManager;
import org.crosswire.jsword.book.Book;
import java.util.ArrayList;

View File

@ -7,15 +7,16 @@ import org.crosswire.jsword.book.Book
import rx.functions.Action0
/**
* Created by bspeice on 9/10/14.
* 'Open' class and values for mockito to subclass
* http://confluence.jetbrains.com/display/Kotlin/Classes+and+Inheritance
*/
//@Singleton
class BookManager() {
open class BookManager() {
// Some extra books like to think they're installed, but trigger NPE all over the place...
val ignore = array("ERen_no", "ot1nt2");
val installedBooks = Observable.from(Books.installed()!!.getBooks())
open val installedBooks = Observable.from(Books.installed()!!.getBooks())
?.filter { !ignore.contains(it!!.getInitials()) }
?.cache()
var refreshComplete = false;