Skip to content

Commit

Permalink
Add the test
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Nov 9, 2022
1 parent 44db927 commit 1e79bed
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.reactivex.rxjava3.android.plugins;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.android.testutil.EmptyScheduler;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertSame;

public final class RxAndroidPluginsNoRobolectricTest {
@Before @After
public void setUpAndTearDown() {
RxAndroidPlugins.reset();
}

@Test public void mainThreadSchedulerCanBeReplaced() {
EmptyScheduler emptyScheduler = new EmptyScheduler();
RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler -> emptyScheduler);
assertSame(emptyScheduler, AndroidSchedulers.mainThread());
}
}

0 comments on commit 1e79bed

Please sign in to comment.