Skip to content

Commit

Permalink
Merge pull request #596 from ReactiveX/jw/fix-non-robolectric/2022-11-09
Browse files Browse the repository at this point in the history
Add the test
  • Loading branch information
JakeWharton committed Nov 9, 2022
2 parents 2100cf9 + 1e79bed commit f3094ad
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 f3094ad

Please sign in to comment.