From 67b11b3ab0ebb3b7f61880df05fb21d11b5f3b74 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 12 Sep 2014 22:36:53 -0400 Subject: [PATCH] Make sure the unit tests pass correctly --- app/build.gradle | 4 +++- .../minimalbible/test/activity/viewer/BibleViewerTest.java | 2 +- .../bspeice/minimalbible/service/manager/BookManager.kt | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4a79309..a289f7c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' + } } \ No newline at end of file diff --git a/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java b/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java index f7b6383..1fffb70 100644 --- a/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java +++ b/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java @@ -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; diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/service/manager/BookManager.kt b/app/src/main/kotlin/org/bspeice/minimalbible/service/manager/BookManager.kt index 7f984e8..eeb8510 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/service/manager/BookManager.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/service/manager/BookManager.kt @@ -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;