Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schedulers.immediate() in tests limits capabilities #6

Open
artemik opened this issue Nov 26, 2016 · 1 comment
Open

Schedulers.immediate() in tests limits capabilities #6

artemik opened this issue Nov 26, 2016 · 1 comment

Comments

@artemik
Copy link

artemik commented Nov 26, 2016

For tests, Schedulers.immediate() is used instead of Schedulers.io() and Schedulers.mainThread(). It makes impossible to test that repoListPresenter.onSearchButtonClick() doesn't call view.hideLoading() until it loads result from the model.

The current RepoListPresenterTest.testShowLoading() show look like this:

@Test
public void testShowLoading() {
	repoListPresenter.onSearchButtonClick();

	verify(mockView).showLoading();
	verify(mockView, never()).hideLoading();
}

But it's impossible now. Invocation of repoListPresenter.onSearchButtonClick() is blocking and will trigger view.hideLoading() upon completion.

@andrey7mel
Copy link
Owner

andrey7mel commented Nov 27, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants