Skip to content

Commit

Permalink
🐍 update RxBus to Rx2.
Browse files Browse the repository at this point in the history
  • Loading branch information
PondThaitay committed Apr 29, 2017
1 parent 9c8ab54 commit 9cb1dbf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ dependencies {

compile 'com.google.code.gson:gson:2.8.0'

compile ('com.hwangjr.rxbus:rxbus:1.0.5') {
compile ('com.hwangjr.rxbus:rxbus:2.0.0-beta') {
exclude group: 'com.jakewharton.timber', module: 'timber'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.wisdomlanna.www.dagger2_mvp_example.ui.base;

import com.hwangjr.rxbus.Bus;

public class RxBusProvider {

private static Bus sBus;

public static synchronized Bus get() {
if (sBus == null) {
sBus = new Bus();
}
return sBus;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;

Expand All @@ -46,6 +45,8 @@ public class MainPresenterTest {
private MainInterface.View mockView;
@Mock
private GitHubApi gitHubApi;
@Mock
private Bus bus;

private MainPresenter presenter;
private JsonMockUtility jsonUtil;
Expand All @@ -62,7 +63,6 @@ public void setup() {
presenter = new MainPresenter(gitHubApi);
presenter.attachView(mockView);

Bus bus = mock(Bus.class);
when(RxBus.get()).thenReturn(bus);
}

Expand Down

0 comments on commit 9cb1dbf

Please sign in to comment.