robstoll
02/07/2018, 1:53 PMjacob
02/23/2018, 5:14 AMJesper Hasselström
02/23/2018, 9:59 AMjk
02/23/2018, 10:15 AMDominik.sittel
02/23/2018, 2:24 PMrrva
02/23/2018, 2:39 PMcopy()
on to create different input to the test cases. Anything else? Examples appreciated!jk
02/24/2018, 6:16 PMjk
03/07/2018, 12:40 PMjanvladimirmostert
03/08/2018, 10:15 AMgildor
03/08/2018, 10:18 AMOleksii Malovanyi
04/04/2018, 2:29 PMmemoized
is not documented (and doesnt work with CachingMode.GROUP
for on
) on 1.1.5 – is it intended to use only starting from 2.x release?radityagumay
04/07/2018, 4:53 AMradityagumay
04/09/2018, 6:59 AMv79
04/20/2018, 5:59 PMgradlew clean test
reports 5 actionable tasks: 5 executed
(there are 5 test files) but there's no console logging, even when tests fail. The tests run in IntelliJ as expected.radityagumay
04/21/2018, 2:42 AMwhenever
or on
block.
because
repository.fetchWeather() willReturnSingle weatherData // this weatherData from fixture
presenter.fetchWeather()
should be done in whenever or on blockkingsley.gomes
04/26/2018, 11:59 AM@RunWith(JUnitPlatform::class)
class AccountCheckViewModelTest : Spek({
include(RxSchedulersOverrideRule)
val httpException = mock<HttpException> {
on { code() }.thenReturn(400)
}
given(" account check") {
var accountCheckRequest = mock<CheckExistingAccountRequest>()
var accountCheckResponse = mock<CheckExistingAccountResponse>()
var webService = mock<IAPICalls>()
val accountCheckViewModel = spy(VMAccountCheck(webService))
beforeEachTest {
accountCheckRequest = mock<CheckExistingAccountRequest>() {
on { email }.thenReturn("foo@mail")
}
accountCheckResponse = mock<CheckExistingAccountResponse>() {
on { firstName }.thenReturn("foo")
on { email }.thenReturn("foo@mail")
}
webService = mock<IAPICalls> {
on { checkExistingAccount(accountCheckRequest) }.thenReturn(Flowable.just(accountCheckResponse))
}
}
on("api success") {
accountCheckViewModel.checkIfAccountExists(request = accountCheckRequest)
it("it:: should call live data with first name as foo") {
verify(accountCheckViewModel, times(1)).updateLiveData(accountCheckResponse.firstName, accountCheckResponse.email, null)
}
}
}
and associated stacktrace : https://pastebin.com/gy6dLtGgchristophsturm
04/26/2018, 4:17 PMsatejs
04/27/2018, 6:21 AMgradle test
, is it possible to get a break up of which tests have failed? Additionally, when I run gradle test
for the second time, it doesn't run the tests again. Could someone help with this?rafal
05/21/2018, 1:24 PMdave08
05/30/2018, 5:09 AMdave08
05/30/2018, 1:54 PMmemoized
val
declared in given
inside on
?rook
06/01/2018, 3:13 PMbeforeGroup
and afterGroup
called? In previously working tests, I’m suddenly getting an error in my afterGroup
block that seems to indicate it’s being run before my beforeGroup
has been run
beforeGroup {
presenter.takeView(view) //this opens a dao connection
}
afterGroup {
presenter.dropView(view) //this closes the dao connection
}
//error generated: kotlin.UninitializedPropertyAccessException: lateinit property dao has not been initialized
dave08
06/05/2018, 3:54 PMmemoized
work? I have something like this:
class Test : Spek {
val something by memoized { mockk<ISomething>() }
given("do this") {
every { something.doThis() } returns true
on("that happened") {
it("verify") {
.....
}
The something doesn't have the value true I gave it on given
... I tried using other caching strategies, but natta...gabriel.pereira.au
06/08/2018, 12:32 AMquiqua
06/09/2018, 8:44 PMinternal class StatsViewModelSpek : Spek({
describe("a StatsViewModel") {
beforeEachTest {
// Junit Rule to apply
InstantTaskExecutorRule()
}
context("") {
val stats = Stats()
on("create") {
it("should initialize without problems") {
val statsViewModel = StatsViewModel(stats)
}
}
}
}
})
This returns java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked
, because I use LiveData
inside that viewModelrobfletcher
06/25/2018, 9:40 PMlatest.release
or +
in Gradle that’s the version you’ll get because 1.1.19 looks higher than 1.1.5 even though it’s a year older. With Gradle’s new dependency locking feature this is more noticeable (because using dynamic versions like that is no longer necessarily an easy way to shoot yourself in the foot). I notice that version was not synced to Maven Central so it’s only on mutable repos.robfletcher
06/26/2018, 5:20 PMchristophsturm
06/28/2018, 9:20 AMraniejade
07/03/2018, 9:18 AMHamza
07/07/2018, 5:22 PMHamza
07/07/2018, 5:22 PMradityagumay
07/14/2018, 5:24 PM