From acbdc101166bb66fe56b0ee53fa6c39e0585e78d Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 21 Nov 2014 00:12:04 -0500 Subject: [PATCH] Add an initial specification I guess it's cool, not sure it's doing much for me right now... --- .../src/test/kotlin/DLProgressEventTest.kt | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app-test/src/test/kotlin/DLProgressEventTest.kt b/app-test/src/test/kotlin/DLProgressEventTest.kt index b114d9a..dbad40e 100644 --- a/app-test/src/test/kotlin/DLProgressEventTest.kt +++ b/app-test/src/test/kotlin/DLProgressEventTest.kt @@ -2,19 +2,25 @@ * Created by bspeice on 11/20/14. */ -import org.junit.Test import org.bspeice.minimalbible.activity.downloader.manager.DLProgressEvent import org.crosswire.jsword.book.Book -import org.mockito.Mockito -import org.junit.Assert +import org.mockito.Mockito.mock +import org.jetbrains.spek.api.Spek +import kotlin.test.assertEquals -class DLProgressEventTest { +class DLProgressEventSpecs : Spek() {{ - val b = Mockito.mock(javaClass()) + given("a DLProgressEvent created with 50% progress and a mock book") { + val mockBook = mock(javaClass()) + val dlEvent = DLProgressEvent(50, mockBook) - Test fun fiftyPercentIsOneEighty() { + on("getting the progress in degrees") { + val progressDegrees = dlEvent.toCircular() - val e = DLProgressEvent(50, b) - Assert.assertEquals(180, e.toCircular()) + it("should be 180 degrees") { + assertEquals(180, progressDegrees) + } + } } } +}