Skip to content

Instantly share code, notes, and snippets.

@rozkminiacz
Created March 12, 2018 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rozkminiacz/ef78640fc6481a34a31b28d909944fd1 to your computer and use it in GitHub Desktop.
Save rozkminiacz/ef78640fc6481a34a31b28d909944fd1 to your computer and use it in GitHub Desktop.
given("no people in repository"){
val view: PeopleListContract.View = mock()
val repository : Repository<Person> = mock {
on { getAll() } doReturn Single.error(Error("no data"))
}
val presenter = PeopleListPresenter(repository)
on("presenter attach"){
presenter.attach(view)
presenterAttachStandardFlow(view, presenter){
it("should not add anything to view"){
verify(view, never()).addPeople(any())
}
it("should display error in view"){
verify(view).showError(any())
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment